These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * This file is part of phpDocumentor. |
||
4 | * |
||
5 | * For the full copyright and license information, please view the LICENSE |
||
6 | * file that was distributed with this source code. |
||
7 | * |
||
8 | * @copyright 2010-2018 Mike van Riel<[email protected]> |
||
9 | * @license http://www.opensource.org/licenses/mit-license.php MIT |
||
10 | * @link http://phpdoc.org |
||
11 | */ |
||
12 | |||
13 | interface ExampleInterface |
||
0 ignored issues
–
show
|
|||
14 | { |
||
15 | /** |
||
16 | * Do something with $object and return that it worked |
||
17 | * |
||
18 | * @param \stdClass $object The object |
||
19 | * @return bool |
||
20 | */ |
||
21 | public function doSomething(\stdClass $object); |
||
22 | } |
||
23 | |||
24 | class Example implements ExampleInterface |
||
0 ignored issues
–
show
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
Loading history...
|
|||
25 | { |
||
26 | /** {@inheritdoc} */ |
||
27 | public function doSomething(\stdClass $object) |
||
28 | { |
||
29 | // what ever |
||
30 | return true; |
||
31 | } |
||
32 | } |
||
33 | |||
34 | interface DeepExampleInterface extends ExampleInterface |
||
0 ignored issues
–
show
Each interface must be in a namespace of at least one level (a top-level vendor name)
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
Loading history...
|
|||
35 | { |
||
36 | /** |
||
37 | * Convert $json to object and doSomething |
||
38 | * |
||
39 | * @param string $json |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function doSomethingJson($json); |
||
43 | } |
||
44 | |||
45 | class DeepExample extends Example implements DeepExampleInterface |
||
0 ignored issues
–
show
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.
You can fix this by adding a namespace to your class: namespace YourVendor;
class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
Loading history...
|
|||
46 | { |
||
47 | /** {@inheritdoc} */ |
||
48 | public function doSomethingJson($json) |
||
49 | { |
||
50 | return $this->doSomething(json_encode($json)); |
||
51 | } |
||
52 | |||
53 | /** {@inheritdoc} */ |
||
54 | public function doSomething(\stdClass $object) |
||
55 | { |
||
56 | // do something really special |
||
57 | return true; |
||
58 | } |
||
59 | } |
||
60 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.