Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
NoArgsConstructor
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 verifySignature
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
2
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * NoArgsConstructor class implementation file
4 * @package Code\Simplify
5 * @author Felipe Gaspar <felipesouzalimagaspar@gmail.com>
6 */
7declare(strict_types=1);
8namespace Code\Simplify;
9
10#[\Attribute(\Attribute::TARGET_CLASS)]
11/**
12 * Implements a constructor method without any attributes
13 * @final
14 */
15final class NoArgsConstructor extends Constructor {
16    /**
17     * Checks if the called method has the matching signature
18     * @access public
19     * @param string $name Method name
20     * @param array $arguments Method arguments
21     * @return bool The called method has the matching signature or not
22     */
23    public function verifySignature(string $name, array $arguments = []) : bool {
24        return $name === '__construct' && count($arguments) === 0;
25    }
26    public function __construct() {
27        parent::__construct();
28    }
29}