for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tylercd100\Validator\Phone;
use Illuminate\Support\ServiceProvider as IlluminateProvider;
use Tylercd100\Validator\Phone\Validator;
class ServiceProvider extends IlluminateProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
}
* Register the service provider.
public function register()
$this->app->resolving('validator', function ($factory, $app) {
$app
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$x = new Validator();
$factory->extend('phone', function ($attribute, $value, $parameters, $validator) use ($x) {
$validator
if (count($parameters) > 0) {
switch ($parameters[0]) {
case 'e164':
case 'E164':
return $x->isE164($value);
isE164()
Tylercd100\Validator\Phone\Validator
This check looks for access to methods that are not accessible from the current context.
If you need to make a method accessible to another context you can raise its visibility level in the defining class.
case 'nanp':
case 'NANP':
return $x->isNANP($value);
isNANP()
default:
return $x->isPhone($value);
isPhone()
} else {
}, "Not a valid phone number");
});
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.