Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

remove quotes from assert assertions #20

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ environment:
PHP_DIR: C:\tools\php
XDEBUG_VERSION: 2.5.0
matrix:
- PHP_VERSION: 5.6
XDEBUG_VC_VERSION: 11
- PHP_VERSION: 7.0
XDEBUG_VC_VERSION: 14
- PHP_VERSION: 7.1
XDEBUG_VC_VERSION: 14
- PHP_VERSION: 7.2
XDEBUG_VC_VERSION: 15

matrix:
fast_finish: true
Expand All @@ -31,7 +31,7 @@ pull_requests:
do_not_increment_build_number: true

install:
- ps: appveyor-retry cinst --ignore-checksums --limit-output --yes php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:PHP_VERSION | Select-Object -first 1) -replace '[php|]','')
- ps: appveyor-retry cinst --force --ignore-checksums --limit-output --yes php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:PHP_VERSION | Select-Object -first 1) -replace '[php|]','')
- CD %PHP_DIR%
- COPY /Y php.ini-development php.ini
- ECHO data.timezone="UTC" >> php.ini
Expand Down
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- 7.2
- nightly
- hhvm

env:
global:
- COVERAGE_VERSION=7.1
- COVERAGE_VERSION=7.2
- PATH=$TRAVIS_BUILD_DIR/vendor/bin:$PATH

matrix:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.0",
"symfony/polyfill-php71": "^1.3"
},
"require-dev": {
Expand Down
18 changes: 9 additions & 9 deletions src/Variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final public static function allMatch($var, $pattern) {
* @return bool
*/
final public static function applyCallback($var, callable $callback, $pass_delta = true) {
assert('is_bool($pass_delta)', 'Third argument must be of type bool.');
assert(is_bool($pass_delta), 'Third argument must be of type bool.');

if (is_iterable($var)) {
/** @noinspection ForeachSourceInspection */
Expand All @@ -80,8 +80,8 @@ final public static function applyCallback($var, callable $callback, $pass_delta
* @return bool
*/
final public static function contains($var, $needle, $case_sensitive = false) {
assert('is_string($needle) && $needle !== \'\'', 'second argument must be of type string and have content');
assert('is_bool($case_sensitive)', 'third argument must be of type bool');
assert(is_string($needle) && $needle !== '', 'second argument must be of type string and have content');
assert(is_bool($case_sensitive), 'third argument must be of type bool');

if (!is_bool($var) && (is_scalar($var) || method_exists($var, '__toString'))) {
if ($case_sensitive) {
Expand Down Expand Up @@ -452,8 +452,8 @@ final public static function hasTraversablesOnly($var) {
* @return bool
*/
final public static function isInstanceOf($var, $class, $allow_string = true) {
assert('is_object($class) || is_string($class)', 'second argument must be of type object or string');
assert('is_bool($allow_string)', 'third argument must be of type bool');
assert(is_object($class) || is_string($class), 'second argument must be of type object or string');
assert(is_bool($allow_string), 'third argument must be of type bool');

if (is_object($class)) {
$class = get_class($class);
Expand Down Expand Up @@ -505,7 +505,7 @@ final public static function isPositiveNaturalNumber($var) {
* @return bool
*/
final public static function isRealNumber($var, $scale = self::BC_MATH_DEFAULT_SCALE) {
assert('Variable::isScalarNaturalNumber($scale)', 'BC Math scale must be a natural number (ℕ₀) of type int');
assert(Variable::isScalarNaturalNumber($scale), 'BC Math scale must be a natural number (ℕ₀) of type int');

if (is_numeric($var)) {
if (filter_var($var, FILTER_VALIDATE_FLOAT) !== false) {
Expand Down Expand Up @@ -631,8 +631,8 @@ final public static function isStringableWithContent($var) {
* @return bool
*/
final public static function isSubclassOf($var, $class, $allow_string = true) {
assert('is_object($class) || (is_string($class) && class_exists($class))', 'second argument must be an object or the name of an existing class');
assert('is_bool($allow_string)', 'third argument must be of type bool');
assert(is_object($class) || (is_string($class) && class_exists($class)), 'second argument must be an object or the name of an existing class');
assert(is_bool($allow_string), 'third argument must be of type bool');

$str = \is_string($var);

Expand Down Expand Up @@ -669,7 +669,7 @@ final public static function isTraversable($var) {
* @return bool
*/
final public static function matches($var, $pattern) {
assert('is_string($pattern) && $pattern !== \'\'', 'second argument must be of type string and have content');
assert(is_string($pattern) && $pattern !== '', 'second argument must be of type string and have content');

if (!is_bool($var) && (is_scalar($var) || method_exists($var, '__toString'))) {
return preg_match($pattern, $var) === 1;
Expand Down