Detects if your class and methods are too big and suggest to extract responsibilities and collaborators
"require-dev": {
"elfiggo/brobdingnagian-detector":"^0.1.0"
}
Add the following to your phpspec.yml
under extensions
extensions:
- Elfiggo\Brobdingnagian\Extension
See PhpSpec Extension Documentation if you are having trouble
brobdingnagian:
class-size: 300
method-size: 10
number-of-methods: 5
filter-methods:
static: true
public: true
protected: true
private: true
abstract: true
final: true
dependencies: 4
list-brob: true
create-csv: false
number-of-interfaces: 3
number-of-traits: 1
Use as normal with phpspec, if you want to disable exceptions for Brobdingnagian and list the classes, methods or dependencies instead, then pass the following flag, this has precedence over the phpspec.yml parameter.
phpspec r --list-brob=true (Turns Exceptions Off)
phpspec r --list-brob=false (Turns Exceptions On)
Turn off checks for methods that are private or final by setting to false
You can remove the filter-methods
arguments entirely/
Turning off final
but not public
on methods that are final
and public
will still appear as they conform to a public
signiture.
See ReflectionClass::getMethods for more information.
Currently PHP 5.5 and above
Follows php security support release cycle for minimum supported versions
- Ship It! (East Croydon)
- Add Dictionary of suggestible class names for roles
- Ship it! (Blackpool)
- Ask to split class/methods into a helper class
- Create New Helper class with Spec stubs of current class
- Ship it! (Derby)