eappointment/mellon 2.06.05
“Validator for parameters and validation helper”
Basename is uppercase README.mdPHP invokes a variable-named function
SHA-25602342e0b535996df7dfd9480c6cfaf8e95114bb39f0e7a7d43325705cf8feabc
Evidence
1Mellon PHP Validator
2====================
3
4Link to main repository: https://gitlab.com/eappointment/mellon/
5
6Mellon is a validator library using the filter-functions offered by PHP. It is written for PHP micro frameworks which do not have a validation library by themself.
7
8 'Speak, friend, and enter'
9
10-----
11Usage
12-----
13
14In flat PHP, a simple validation would look like this:
15
16```php
⋯8 lines
25```
26
27With a shortcut for all $_REQUEST variables, you could use:
28
29```php
⋯7 lines
37```
38
39To ensure, that nobody uses the superglobals in your project, take a look at the controversial rule in the [PHP MD Config File](phpmd.rules.xml).
40
41--------------
⋯7 lines
1#!/bin/bash
2
3REALPATH=$(which realpath || which readlink)
4REALPATH=$([[ "$REALPATH" =~ 'readlink' ]] && echo "$REALPATH -e" || echo "$REALPATH")
5DIR=$(dirname $($REALPATH ${BASH_SOURCE[0]}))
6ROOT=$($REALPATH $DIR/..)
7
8echo "Configuring application"
9echo $ROOT
10
11mkdir -p $ROOT/.git/hooks
12ln -sf $ROOT/bin/test $ROOT/.git/hooks/pre-commit
1#!/bin/bash
2
3REALPATH=$(which realpath || which readlink)
4REALPATH=$([[ "$REALPATH" =~ 'readlink' ]] && echo "$REALPATH -e" || echo "$REALPATH")
5DIR=$(dirname $($REALPATH ${BASH_SOURCE[0]}))
6ROOT=$($REALPATH $DIR/..)
7
8echo "Testing application"
9cd $ROOT
10$ROOT/vendor/bin/phpcs --standard=psr2 src/ || exit 1
11$ROOT/vendor/bin/phpmd src/ text phpmd.rules.xml || exit 1
12$ROOT/vendor/bin/phpunit || exit 1
110:19… Valid($valid);
111 if (!$valid->hasFailed()) {
112 $action($valid->getValue());
113 }
114 return $this;
115 }
116}
⋯6 lines
7namespace BO\Mellon\Failure;
8
9use BO\Mellon\Valid;
10
11class Exception extends \Exception
⋯12 lines
24 . $validator->getName()
25 . "}=="
26 . htmlspecialchars(escapeshellarg(substr((string)$validator->getUnvalidated(), 0, 65536)), ENT_NOQUOTES)
27 . ")";
28 return $this;
29 }
30}
Showing the top 5 files — 6 more files (18 regions) not shown.
No evidence locations were recorded for this file. Raw result