Lines 100.00% 1 / 1
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
RowHook 100.00% 1 / 1 100.00% 1 / 1 1 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace BlueprintAU\Radiant\Attributes;
6
7/**
8 * Marks a static trait method as a bulk-write hook.
9 *
10 * The method receives the row set (or the update values map) by
11 * reference, in the PHP value space before column encoding. The method
12 * must be static and declare a `void` or `bool` return type — `void` is
13 * an observer; a `bool` return of `false` vetoes the whole write.
14 * Declared in traits, mirroring {@see WriteHook}.
15 */
16#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
17final class RowHook
18{
19    /**
20     * Create a row-hook declaration.
21     *
22     * @param  Hook  $hook
23     */
24    final public function __construct(
25        public Hook $hook,
26    ) {
27    }
28}