Merge pull request #106 from henrywhitaker3/docker-speedtest-client

Small changes
This commit is contained in:
Henry Whitaker
2020-06-18 18:22:15 +01:00
committed by GitHub
25 changed files with 2790 additions and 281 deletions

View File

@@ -1,7 +1,6 @@
FROM linuxserver/nginx
MAINTAINER henrywhitaker3@outlook.com
FROM lsiobase/alpine:3.12 as build-stage
# Install apt stuff
# Install apk stuff
RUN apk add --no-cache --upgrade \
gcc \
cmake \
@@ -9,29 +8,26 @@ RUN apk add --no-cache --upgrade \
libxml2-dev \
build-base \
openssl-dev \
supervisor
# Copy over static files
COPY conf/ /setup/
# Get and compile SpeedTest++
RUN cd /tmp && \
git && \
cd /tmp && \
git clone https://github.com/taganaka/SpeedTest && \
cd SpeedTest && \
cmake -DCMAKE_BUILD_TYPE=Release . && \
cd /tmp/SpeedTest && \
make install && \
mv /usr/local/bin/SpeedTest /setup/site/app/Bin/
make install
# Setup new init script
RUN cp /setup/entrypoint/init.sh /etc/cont-init.d/50-speedtest
FROM linuxserver/nginx
MAINTAINER henrywhitaker3@outlook.com
# Update webroot
RUN cp /setup/default /defaults/default
# Install apt stuff
# RUN apk add --no-cache --upgrade supervisor
RUN mkdir -p /etc/services.d/supervisord/ && \
cp /setup/supervisor-service.sh /etc/services.d/supervisord/run && \
mkdir -p /etc/supervisor.d/ && \
cp /setup/laravel-worker.conf /etc/supervisor.d/laravel-worker.ini
# Copy over static files
COPY conf/ /
# Get SpeedTest++
COPY --from=build-stage /usr/local/bin/SpeedTest /site/app/Bin/
EXPOSE 80 443
VOLUME ["/config"]

View File

@@ -1,6 +1,6 @@
# Speedtest Tracker
[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.5.3-success) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) [![commit_freq](https://img.shields.io/github/commit-activity/m/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) ![version](https://img.shields.io/badge/version-v1.5.4-success) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
This program runs a speedtest check every hour and graphs the results. The back-end is written in [Laravel](https://laravel.com/) and the front-end uses [React](https://reactjs.org/). It uses the [SpeedTest++](https://github.com/taganaka/SpeedTest) package to get the data and uses [Chart.js](https://www.chartjs.org/) to plot the results.

9
conf/defaults/crontab Normal file
View File

@@ -0,0 +1,9 @@
# do daily/weekly/monthly maintenance
# min hour day month weekday command
*/15 * * * * run-parts /etc/periodic/15min
0 * * * * run-parts /etc/periodic/hourly
0 2 * * * run-parts /etc/periodic/daily
0 3 * * 6 run-parts /etc/periodic/weekly
0 5 1 * * run-parts /etc/periodic/monthly
# speedtest cron
* * * * * php /config/www/artisan schedule:run >> /config/log/speedtest/cron.log

View File

@@ -3,10 +3,7 @@
# Copy site files to /config
echo "Copying latest site files to config"
cp -rfT /setup/site/ /config/www/
chown -R abc:abc /config/www
chmod -R 755 /config/www/storage
chmod -R 755 /config/www/bootstrap
cp -rfT /site/ /config/www/
# Check for DB
if [ ! -f /config/speed.db ]; then
@@ -21,7 +18,7 @@ fi
# Check for .env
if [ ! -f /config/www/.env ]; then
echo "Env file not found! Creating .env file"
cp /setup/site/.env.example /config/www/.env
cp /site/.env.example /config/www/.env
else
echo "Env file exists"
fi
@@ -32,7 +29,7 @@ echo "Running database migrations"
php /config/www/artisan migrate
# Check app key exists
if cat /config/www/.env | grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" > /dev/null ; then
if grep -E "APP_KEY=[0-9A-Za-z:+\/=]{1,}" /config/www/.env > /dev/null; then
echo "App key exists"
else
echo "Generating app key"
@@ -40,7 +37,7 @@ else
fi
# Check JWT secret exists
if cat /config/www/.env | grep -E "JWT_SECRET=[0-9A-Za-z:+\/=]{1,}" > /dev/null ; then
if grep -E "JWT_SECRET=[0-9A-Za-z:+\/=]{1,}" /config/www/.env > /dev/null ; then
echo "JWT secret exists"
else
echo "Generating JWT secret"
@@ -64,4 +61,7 @@ else
fi
mkdir -p /config/log/speedtest
echo "* * * * * php /config/www/artisan schedule:run >> /config/log/speedtest/cron.log" >> /etc/crontabs/root
cp /defaults/crontab /etc/crontabs/root
chown -R abc:abc /config

View File

@@ -0,0 +1,3 @@
#!/usr/bin/with-contenv bash
exec s6-setuidgid abc php /config/www/artisan queue:work --timeout=120 >> /config/log/speedtest/queue.log

View File

@@ -1,9 +0,0 @@
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /config/www/artisan queue:work --timeout=120
autostart=true
autorestart=true
user=abc
numprocs=1
redirect_stderr=true
logfile=/config/log/speedtest/laravel-worker.log

View File

@@ -0,0 +1,120 @@
//
// Created by Francesco Laurita on 6/2/16.
//
#ifndef SPEEDTEST_TESTCONFIGTEMPLATE_H
#define SPEEDTEST_TESTCONFIGTEMPLATE_H
#include "SpeedTest.h"
const TestConfig preflightConfigDownload = {
600000, // start_size
2000000, // max_size
125000, // inc_size
4096, // buff_size
10000, // min_test_time_ms
1, // Concurrency
"Preflight check"
};
const TestConfig slowConfigDownload = {
100000, // start_size
500000, // max_size
10000, // inc_size
1024, // buff_size
20000, // min_test_time_ms
1, // Concurrency
"Very-slow-line line type detected: profile selected slowband"
};
const TestConfig slowConfigUpload = {
50000, // start_size
80000, // max_size
1000, // inc_size
1024, // buff_size
20000, // min_test_time_ms
1, // Concurrency
"Very-slow-line line type detected: profile selected slowband"
};
const TestConfig narrowConfigDownload = {
1000000, // start_size
100000000, // max_size
750000, // inc_size
4096, // buff_size
20000, // min_test_time_ms
1, // Concurrency
"Buffering-lover line type detected: profile selected narrowband"
};
const TestConfig narrowConfigUpload = {
1000000, // start_size
100000000, // max_size
550000, // inc_size
4096, // buff_size
20000, // min_test_time_ms
1, // Concurrency
"Buffering-lover line type detected: profile selected narrowband"
};
const TestConfig broadbandConfigDownload = {
1000000, // start_size
100000000, // max_size
750000, // inc_size
65536, // buff_size
20000, // min_test_time_ms
1, // concurrency
"Broadband line type detected: profile selected broadband"
};
const TestConfig broadbandConfigUpload = {
1000000, // start_size
70000000, // max_size
250000, // inc_size
65536, // buff_size
20000, // min_test_time_ms
1, // concurrency
"Broadband line type detected: profile selected broadband"
};
const TestConfig fiberConfigDownload = {
5000000, // start_size
120000000, // max_size
950000, // inc_size
65536, // buff_size
20000, // min_test_time_ms
1, // concurrency
"Fiber / Lan line type detected: profile selected fiber"
};
const TestConfig fiberConfigUpload = {
1000000, // start_size
70000000, // max_size
250000, // inc_size
65536, // buff_size
20000, // min_test_time_ms
1, // concurrency
"Fiber / Lan line type detected: profile selected fiber"
};
void testConfigSelector(const double preSpeed, TestConfig& uploadConfig, TestConfig& downloadConfig){
uploadConfig = slowConfigUpload;
downloadConfig = slowConfigDownload;
if (preSpeed > 4 && preSpeed <= 30){
downloadConfig = narrowConfigDownload;
uploadConfig = narrowConfigUpload;
} else if (preSpeed > 30 && preSpeed < 150) {
downloadConfig = broadbandConfigDownload;
uploadConfig = broadbandConfigUpload;
} else if (preSpeed >= 150) {
downloadConfig = fiberConfigDownload;
uploadConfig = fiberConfigUpload;
}
}
#endif //SPEEDTEST_TESTCONFIGTEMPLATE_H

View File

@@ -1,6 +1,6 @@
# Speedtest Tracker
[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) ![version](https://img.shields.io/badge/version-v1.5.3-success) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
[![Docker pulls](https://img.shields.io/docker/pulls/henrywhitaker3/speedtest-tracker)](https://hub.docker.com/r/henrywhitaker3/speedtest-tracker) [![last_commit](https://img.shields.io/github/last-commit/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/commits) [![issues](https://img.shields.io/github/issues/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/issues) ![version](https://img.shields.io/badge/version-v1.5.4-success) [![license](https://img.shields.io/github/license/henrywhitaker3/Speedtest-Tracker)](https://github.com/henrywhitaker3/Speedtest-Tracker/blob/master/LICENSE)
This program runs a speedtest check every hour and graphs the results. The back-end is written in [Laravel](https://laravel.com/) and the front-end uses [React](https://reactjs.org/). It uses the [speedtest-cli](https://github.com/sivel/speedtest-cli) package to get the data and uses [Chart.js](https://www.chartjs.org/) to plot the results.

View File

@@ -1,4 +1,10 @@
{
"1.5.4": [
{
"description": "Updated dependencies",
"link": ""
}
],
"1.5.3": [
{
"description": "Changed speedtest client",

597
conf/site/composer.lock generated
View File

@@ -102,6 +102,12 @@
"brick",
"math"
],
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/brick/math",
"type": "tidelift"
}
],
"time": "2020-04-15T15:59:35+00:00"
},
{
@@ -212,6 +218,20 @@
"uppercase",
"words"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2020-05-29T15:13:26+00:00"
},
{
@@ -274,6 +294,20 @@
"parser",
"php"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
"type": "tidelift"
}
],
"time": "2020-05-25T17:44:05+00:00"
},
{
@@ -510,6 +544,12 @@
"crossdomain",
"laravel"
],
"funding": [
{
"url": "https://github.com/barryvdh",
"type": "github"
}
],
"time": "2020-05-31T07:30:16+00:00"
},
{
@@ -1161,6 +1201,32 @@
"md",
"parser"
],
"funding": [
{
"url": "https://enjoy.gitstore.app/repositories/thephpleague/commonmark",
"type": "custom"
},
{
"url": "https://www.colinodell.com/sponsor",
"type": "custom"
},
{
"url": "https://www.paypal.me/colinpodell/10.00",
"type": "custom"
},
{
"url": "https://github.com/colinodell",
"type": "github"
},
{
"url": "https://www.patreon.com/colinodell",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/league/commonmark",
"type": "tidelift"
}
],
"time": "2020-05-04T22:15:21+00:00"
},
{
@@ -1245,6 +1311,12 @@
"sftp",
"storage"
],
"funding": [
{
"url": "https://offset.earth/frankdejonge",
"type": "other"
}
],
"time": "2020-05-18T15:13:39+00:00"
},
{
@@ -1326,6 +1398,16 @@
"logging",
"psr-3"
],
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
"type": "tidelift"
}
],
"time": "2020-05-22T08:12:19+00:00"
},
{
@@ -1462,6 +1544,16 @@
"datetime",
"time"
],
"funding": [
{
"url": "https://opencollective.com/Carbon",
"type": "open_collective"
},
{
"url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
"type": "tidelift"
}
],
"time": "2020-05-24T18:27:52+00:00"
},
{
@@ -1518,16 +1610,17 @@
},
{
"name": "opis/closure",
"version": "3.5.4",
"version": "3.5.5",
"source": {
"type": "git",
"url": "https://github.com/opis/closure.git",
"reference": "1d0deef692f66dae5d70663caee2867d0971306b"
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opis/closure/zipball/1d0deef692f66dae5d70663caee2867d0971306b",
"reference": "1d0deef692f66dae5d70663caee2867d0971306b",
"url": "https://api.github.com/repos/opis/closure/zipball/dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
"shasum": ""
},
"require": {
@@ -1575,7 +1668,7 @@
"serialization",
"serialize"
],
"time": "2020-06-07T11:41:29+00:00"
"time": "2020-06-17T14:59:55+00:00"
},
{
"name": "phpoption/phpoption",
@@ -1630,6 +1723,16 @@
"php",
"type"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
"type": "tidelift"
}
],
"time": "2020-06-07T10:40:07+00:00"
},
{
@@ -2124,6 +2227,12 @@
"identifier",
"uuid"
],
"funding": [
{
"url": "https://github.com/ramsey",
"type": "github"
}
],
"time": "2020-03-29T20:13:32+00:00"
},
{
@@ -2265,6 +2374,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-15T12:59:21+00:00"
},
{
@@ -2318,6 +2441,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@@ -2364,6 +2501,20 @@
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-27T08:34:37+00:00"
},
{
@@ -2421,6 +2572,20 @@
],
"description": "Symfony ErrorHandler Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
},
{
@@ -2493,6 +2658,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@@ -2551,6 +2730,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@@ -2600,6 +2793,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@@ -2661,6 +2868,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-15T06:52:54+00:00"
},
{
@@ -2760,6 +2981,20 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-15T13:51:38+00:00"
},
{
@@ -2823,6 +3058,20 @@
"mime",
"mime-type"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-09T15:07:35+00:00"
},
{
@@ -2881,6 +3130,20 @@
"polyfill",
"portable"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:14:59+00:00"
},
{
@@ -2940,6 +3203,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@@ -3000,6 +3277,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@@ -3062,6 +3353,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@@ -3125,6 +3430,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:14:59+00:00"
},
{
@@ -3184,6 +3503,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@@ -3240,6 +3573,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-03-09T19:04:49+00:00"
},
{
@@ -3295,6 +3642,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@@ -3353,6 +3714,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@@ -3415,6 +3790,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:47:27+00:00"
},
{
@@ -3467,6 +3856,20 @@
"polyfill",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-03-02T11:55:35+00:00"
},
{
@@ -3517,6 +3920,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
},
{
@@ -3595,6 +4012,20 @@
"uri",
"url"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-10T11:49:58+00:00"
},
{
@@ -3653,6 +4084,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@@ -3724,6 +4169,20 @@
"utf-8",
"utf8"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-11T12:16:36+00:00"
},
{
@@ -3802,6 +4261,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
},
{
@@ -3859,6 +4332,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@@ -3935,6 +4422,20 @@
"debug",
"dump"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
},
{
@@ -4058,6 +4559,12 @@
"jwt",
"laravel"
],
"funding": [
{
"url": "https://www.patreon.com/seantymon",
"type": "patreon"
}
],
"time": "2020-03-04T11:21:28+00:00"
},
{
@@ -4122,6 +4629,16 @@
"env",
"environment"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"time": "2020-06-07T18:25:35+00:00"
},
{
@@ -4170,6 +4687,24 @@
"clean",
"php"
],
"funding": [
{
"url": "https://www.paypal.me/moelleken",
"type": "custom"
},
{
"url": "https://github.com/voku",
"type": "github"
},
{
"url": "https://www.patreon.com/voku",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii",
"type": "tidelift"
}
],
"time": "2020-06-15T23:49:30+00:00"
}
],
@@ -4282,6 +4817,12 @@
"flare",
"reporting"
],
"funding": [
{
"url": "https://www.patreon.com/spatie",
"type": "patreon"
}
],
"time": "2020-03-02T15:52:04+00:00"
},
{
@@ -4739,6 +5280,20 @@
"php",
"symfony"
],
"funding": [
{
"url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
},
{
"url": "https://www.patreon.com/nunomaduro",
"type": "patreon"
}
],
"time": "2020-04-04T19:56:08+00:00"
},
{
@@ -5387,7 +5942,17 @@
"testing",
"xunit"
],
"time": "2020-06-15T10:45:47+00:00"
"funding": [
{
"url": "https://phpunit.de/donate.html",
"type": "custom"
},
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-05-22T13:51:52+00:00"
},
{
"name": "scrivo/highlight.php",
@@ -5456,6 +6021,12 @@
"highlight.php",
"syntax"
],
"funding": [
{
"url": "https://github.com/allejo",
"type": "github"
}
],
"time": "2020-03-02T05:59:21+00:00"
},
{
@@ -6115,16 +6686,16 @@
},
{
"name": "webmozart/assert",
"version": "1.8.0",
"version": "1.9.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
"reference": "9dc4f203e36f2b486149058bade43c851dd97451"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451",
"reference": "9dc4f203e36f2b486149058bade43c851dd97451",
"shasum": ""
},
"require": {
@@ -6132,6 +6703,7 @@
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<3.9.1"
},
"require-dev": {
@@ -6159,7 +6731,7 @@
"check",
"validate"
],
"time": "2020-04-18T12:12:48+00:00"
"time": "2020-06-16T10:16:42+00:00"
}
],
"aliases": [],
@@ -6170,5 +6742,6 @@
"platform": {
"php": "^7.2.5"
},
"platform-dev": []
"platform-dev": [],
"plugin-api-version": "1.1.0"
}

View File

@@ -7,7 +7,7 @@ return [
|--------------------------------------------------------------------------
*/
'version' => '1.5.3',
'version' => '1.5.4',
/*
|--------------------------------------------------------------------------

View File

@@ -4437,6 +4437,7 @@ return array(
'Tymon\\JWTAuth\\Validators\\Validator' => $vendorDir . '/tymon/jwt-auth/src/Validators/Validator.php',
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
'Webmozart\\Assert\\Assert' => $vendorDir . '/webmozart/assert/src/Assert.php',
'Webmozart\\Assert\\Mixin' => $vendorDir . '/webmozart/assert/src/Mixin.php',
'Whoops\\Exception\\ErrorException' => $vendorDir . '/filp/whoops/src/Whoops/Exception/ErrorException.php',
'Whoops\\Exception\\Formatter' => $vendorDir . '/filp/whoops/src/Whoops/Exception/Formatter.php',
'Whoops\\Exception\\Frame' => $vendorDir . '/filp/whoops/src/Whoops/Exception/Frame.php',

View File

@@ -8,14 +8,11 @@ $baseDir = dirname($vendorDir);
return array(
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php',
'2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
@@ -30,7 +27,10 @@ return array(
'58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
'9cdd7b9056abc3081735233ba9dd9c7f' => $vendorDir . '/facade/flare-client-php/src/helpers.php',
'b6ec61354e97f32c0ae683041c78392a' => $vendorDir . '/scrivo/highlight.php/HighlightUtilities/functions.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php',
'ed962a97bd972bc82007176b647d4e36' => $vendorDir . '/facade/ignition/src/helpers.php',
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
);

View File

@@ -9,14 +9,11 @@ class ComposerStaticInita54da675f7e63b2b06cffe7d297f5df8
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php',
'2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php',
@@ -31,9 +28,12 @@ class ComposerStaticInita54da675f7e63b2b06cffe7d297f5df8
'58571171fd5812e6e447dce228f52f4d' => __DIR__ . '/..' . '/laravel/framework/src/Illuminate/Support/helpers.php',
'9cdd7b9056abc3081735233ba9dd9c7f' => __DIR__ . '/..' . '/facade/flare-client-php/src/helpers.php',
'b6ec61354e97f32c0ae683041c78392a' => __DIR__ . '/..' . '/scrivo/highlight.php/HighlightUtilities/functions.php',
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php',
'ed962a97bd972bc82007176b647d4e36' => __DIR__ . '/..' . '/facade/ignition/src/helpers.php',
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
);
public static $prefixLengthsPsr4 = array (
@@ -4947,6 +4947,7 @@ class ComposerStaticInita54da675f7e63b2b06cffe7d297f5df8
'Tymon\\JWTAuth\\Validators\\Validator' => __DIR__ . '/..' . '/tymon/jwt-auth/src/Validators/Validator.php',
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
'Webmozart\\Assert\\Assert' => __DIR__ . '/..' . '/webmozart/assert/src/Assert.php',
'Webmozart\\Assert\\Mixin' => __DIR__ . '/..' . '/webmozart/assert/src/Mixin.php',
'Whoops\\Exception\\ErrorException' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Exception/ErrorException.php',
'Whoops\\Exception\\Formatter' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Exception/Formatter.php',
'Whoops\\Exception\\Frame' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Exception/Frame.php',

View File

@@ -2144,17 +2144,17 @@
},
{
"name": "opis/closure",
"version": "3.5.4",
"version_normalized": "3.5.4.0",
"version": "3.5.5",
"version_normalized": "3.5.5.0",
"source": {
"type": "git",
"url": "https://github.com/opis/closure.git",
"reference": "1d0deef692f66dae5d70663caee2867d0971306b"
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opis/closure/zipball/1d0deef692f66dae5d70663caee2867d0971306b",
"reference": "1d0deef692f66dae5d70663caee2867d0971306b",
"url": "https://api.github.com/repos/opis/closure/zipball/dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
"shasum": ""
},
"require": {
@@ -2164,7 +2164,7 @@
"jeremeamia/superclosure": "^2.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"time": "2020-06-07T11:41:29+00:00",
"time": "2020-06-17T14:59:55+00:00",
"type": "library",
"extra": {
"branch-alias": {
@@ -6312,17 +6312,17 @@
},
{
"name": "webmozart/assert",
"version": "1.8.0",
"version_normalized": "1.8.0.0",
"version": "1.9.0",
"version_normalized": "1.9.0.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
"reference": "9dc4f203e36f2b486149058bade43c851dd97451"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451",
"reference": "9dc4f203e36f2b486149058bade43c851dd97451",
"shasum": ""
},
"require": {
@@ -6330,12 +6330,13 @@
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<3.9.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
},
"time": "2020-04-18T12:12:48+00:00",
"time": "2020-06-16T10:16:42+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {

View File

@@ -1,6 +1,10 @@
CHANGELOG
---------
### v3.5.5, 2020.06.17
- Fixed a false-positive when using `Opis\Closure\ReflectionClosure::isScopeRequired` method
### v3.5.4, 2020.06.07
- Fixed a false-positive when using `Opis\Closure\ReflectionClosure::isScopeRequired` method

View File

@@ -569,7 +569,7 @@ class ReflectionClosure extends ReflectionFunction
$context === 'root'
){
if($id_start_ci === 'self' || $id_start_ci === 'static' || $id_start_ci === 'parent'){
if (!$inside_structure) {
if (!$inside_structure && !$id_start_ci === 'static') {
$isUsingScope = true;
}
} elseif (!($php7 && in_array($id_start_ci, $php7_types))){

View File

@@ -3,6 +3,20 @@ Changelog
## UNRELEASED
## 1.9.0
* added better Psalm support for `all*` & `nullOr*` methods
* These methods are now understood by Psalm through a mixin. You may need a newer version of Psalm in order to use this
* added `@psalm-pure` annotation to `Assert::notFalse()`
* added more `@psalm-assert` annotations where appropriate
## Changed
* the `all*` & `nullOr*` methods are now declared on an interface, instead of `@method` annotations.
This interface is linked to the `Assert` class with a `@mixin` annotation. Most IDE's have supported this
for a long time, and you should not lose any autocompletion capabilities. PHPStan has supported this since
version `0.12.20`. This package is marked incompatbible (with a composer conflict) with phpstan version prior to that.
If you do not use PHPStan than this does not matter.
## 1.8.0
@@ -15,7 +29,7 @@ Changelog
### Fixed
* Exception messages of comparisons between `DateTime(Immutalbe)` objects now display their date & time.
* Exception messages of comparisons between `DateTime(Immutable)` objects now display their date & time.
* Custom Exception messages for `Assert::count()` now use the values to render the exception message.
## 1.7.0 (2020-02-14)
@@ -43,7 +57,7 @@ Changelog
They are countable, without implementing the `Countable` interface.
* The doc block of `range` now has the proper variables.
* An empty array will now pass `isList` and `isMap`. As it is a valid form of both.
If a non empty variant is needed, use `isNonEmptyList` or `isNonEmptyMap`.
If a non-empty variant is needed, use `isNonEmptyList` or `isNonEmptyMap`.
### Changed
@@ -52,8 +66,8 @@ If a non empty variant is needed, use `isNonEmptyList` or `isNonEmptyMap`.
* [#145](https://github.com/webmozart/assert/issues/145)
* [#146](https://github.com/webmozart/assert/pull/146)
* [#150](https://github.com/webmozart/assert/pull/150)
* If you use psalm, the minimum version needed is `3.6.0`. Which is enforced through a composer conflict.
If you don't use psalm, then this has no impact.
* If you use Psalm, the minimum version needed is `3.6.0`. Which is enforced through a composer conflict.
If you don't use Psalm, then this has no impact.
## 1.5.0 (2019-08-24)
@@ -66,7 +80,7 @@ If you don't use psalm, then this has no impact.
### Fixed
* `Assert::endsWith()` would not give the correct result when dealing with multibyte suffix.
* `Assert::endsWith()` would not give the correct result when dealing with a multibyte suffix.
* `Assert::length(), minLength, maxLength, lengthBetween` would not give the correct result when dealing with multibyte characters.
**NOTE**: These 2 changes may break your assertions if you relied on the fact that multibyte characters didn't behave correctly.

View File

@@ -104,10 +104,10 @@ Method | Description
`isIterable($value, $message = '')` | Check that a value is an array or a `\Traversable`
`isCountable($value, $message = '')` | Check that a value is an array or a `\Countable`
`isInstanceOf($value, $class, $message = '')` | Check that a value is an `instanceof` a class
`isInstanceOfAny($value, array $classes, $message = '')` | Check that a value is an `instanceof` a at least one class on the array of classes
`isInstanceOfAny($value, array $classes, $message = '')` | Check that a value is an `instanceof` at least one class on the array of classes
`notInstanceOf($value, $class, $message = '')` | Check that a value is not an `instanceof` a class
`isAOf($value, $class, $message = '')` | Check that a value is of the class or has one of its parents
`isAnyOf($value, array $classes, $message = '')` | Check that a value a at least one of the class or has one of its parents
`isAnyOf($value, array $classes, $message = '')` | Check that a value is of at least one of the classes or has one of its parents
`isNotA($value, $class, $message = '')` | Check that a value is not of the class or has not one of its parents
`isArrayAccessible($value, $message = '')` | Check that a value can be accessed as an array
`uniqueValues($values, $message = '')` | Check that the given array contains unique values
@@ -143,7 +143,7 @@ any of the following assertions.
Method | Description
--------------------------------------------------- | -----------------------------------------------------------------
`contains($value, $subString, $message = '')` | Check that a string contains a substring
`notContains($value, $subString, $message = '')` | Check that a string does not contains a substring
`notContains($value, $subString, $message = '')` | Check that a string does not contain a substring
`startsWith($value, $prefix, $message = '')` | Check that a string has a prefix
`notStartsWith($value, $prefix, $message = '')` | Check that a string does not have a prefix
`startsWithLetter($value, $message = '')` | Check that a string starts with a letter

View File

@@ -21,7 +21,8 @@
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
},
"conflict": {
"vimeo/psalm": "<3.9.1"
"vimeo/psalm": "<3.9.1",
"phpstan/phpstan": "<0.12.20"
},
"autoload": {
"psr-4": {
@@ -30,7 +31,8 @@
},
"autoload-dev": {
"psr-4": {
"Webmozart\\Assert\\Tests\\": "tests/"
"Webmozart\\Assert\\Tests\\": "tests/",
"Webmozart\\Assert\\Bin\\": "bin/src"
}
}
}

View File

@@ -7,10 +7,8 @@
phpVersion="7.3"
>
<projectFiles>
<directory name="bin" />
<directory name="tests/static-analysis" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>

View File

@@ -27,188 +27,7 @@ use Traversable;
/**
* Efficient assertions to validate the input/output of your methods.
*
* @method static void nullOrString($value, $message = '')
* @method static void nullOrStringNotEmpty($value, $message = '')
* @method static void nullOrInteger($value, $message = '')
* @method static void nullOrIntegerish($value, $message = '')
* @method static void nullOrFloat($value, $message = '')
* @method static void nullOrNumeric($value, $message = '')
* @method static void nullOrNatural($value, $message = '')
* @method static void nullOrBoolean($value, $message = '')
* @method static void nullOrScalar($value, $message = '')
* @method static void nullOrObject($value, $message = '')
* @method static void nullOrResource($value, $type = null, $message = '')
* @method static void nullOrIsCallable($value, $message = '')
* @method static void nullOrIsArray($value, $message = '')
* @method static void nullOrIsTraversable($value, $message = '')
* @method static void nullOrIsArrayAccessible($value, $message = '')
* @method static void nullOrIsCountable($value, $message = '')
* @method static void nullOrIsIterable($value, $message = '')
* @method static void nullOrIsInstanceOf($value, $class, $message = '')
* @method static void nullOrNotInstanceOf($value, $class, $message = '')
* @method static void nullOrIsInstanceOfAny($value, $classes, $message = '')
* @method static void nullOrIsAOf($value, $classes, $message = '')
* @method static void nullOrIsAnyOf($value, $classes, $message = '')
* @method static void nullOrIsNotA($value, $classes, $message = '')
* @method static void nullOrIsEmpty($value, $message = '')
* @method static void nullOrNotEmpty($value, $message = '')
* @method static void nullOrTrue($value, $message = '')
* @method static void nullOrFalse($value, $message = '')
* @method static void nullOrNotFalse($value, $message = '')
* @method static void nullOrIp($value, $message = '')
* @method static void nullOrIpv4($value, $message = '')
* @method static void nullOrIpv6($value, $message = '')
* @method static void nullOrEmail($value, $message = '')
* @method static void nullOrUniqueValues($values, $message = '')
* @method static void nullOrEq($value, $expect, $message = '')
* @method static void nullOrNotEq($value, $expect, $message = '')
* @method static void nullOrSame($value, $expect, $message = '')
* @method static void nullOrNotSame($value, $expect, $message = '')
* @method static void nullOrGreaterThan($value, $limit, $message = '')
* @method static void nullOrGreaterThanEq($value, $limit, $message = '')
* @method static void nullOrLessThan($value, $limit, $message = '')
* @method static void nullOrLessThanEq($value, $limit, $message = '')
* @method static void nullOrRange($value, $min, $max, $message = '')
* @method static void nullOrOneOf($value, $values, $message = '')
* @method static void nullOrInArray($value, $values, $message = '')
* @method static void nullOrContains($value, $subString, $message = '')
* @method static void nullOrNotContains($value, $subString, $message = '')
* @method static void nullOrNotWhitespaceOnly($value, $message = '')
* @method static void nullOrStartsWith($value, $prefix, $message = '')
* @method static void nullOrNotStartsWith($value, $prefix, $message = '')
* @method static void nullOrStartsWithLetter($value, $message = '')
* @method static void nullOrEndsWith($value, $suffix, $message = '')
* @method static void nullOrNotEndsWith($value, $suffix, $message = '')
* @method static void nullOrRegex($value, $pattern, $message = '')
* @method static void nullOrNotRegex($value, $pattern, $message = '')
* @method static void nullOrUnicodeLetters($value, $message = '')
* @method static void nullOrAlpha($value, $message = '')
* @method static void nullOrDigits($value, $message = '')
* @method static void nullOrAlnum($value, $message = '')
* @method static void nullOrLower($value, $message = '')
* @method static void nullOrUpper($value, $message = '')
* @method static void nullOrLength($value, $length, $message = '')
* @method static void nullOrMinLength($value, $min, $message = '')
* @method static void nullOrMaxLength($value, $max, $message = '')
* @method static void nullOrLengthBetween($value, $min, $max, $message = '')
* @method static void nullOrFileExists($value, $message = '')
* @method static void nullOrFile($value, $message = '')
* @method static void nullOrDirectory($value, $message = '')
* @method static void nullOrReadable($value, $message = '')
* @method static void nullOrWritable($value, $message = '')
* @method static void nullOrClassExists($value, $message = '')
* @method static void nullOrSubclassOf($value, $class, $message = '')
* @method static void nullOrInterfaceExists($value, $message = '')
* @method static void nullOrImplementsInterface($value, $interface, $message = '')
* @method static void nullOrPropertyExists($value, $property, $message = '')
* @method static void nullOrPropertyNotExists($value, $property, $message = '')
* @method static void nullOrMethodExists($value, $method, $message = '')
* @method static void nullOrMethodNotExists($value, $method, $message = '')
* @method static void nullOrKeyExists($value, $key, $message = '')
* @method static void nullOrKeyNotExists($value, $key, $message = '')
* @method static void nullOrValidArrayKey($value, $message = '')
* @method static void nullOrCount($value, $key, $message = '')
* @method static void nullOrMinCount($value, $min, $message = '')
* @method static void nullOrMaxCount($value, $max, $message = '')
* @method static void nullOrIsList($value, $message = '')
* @method static void nullOrIsNonEmptyList($value, $message = '')
* @method static void nullOrIsMap($value, $message = '')
* @method static void nullOrIsNonEmptyMap($value, $message = '')
* @method static void nullOrCountBetween($value, $min, $max, $message = '')
* @method static void nullOrUuid($values, $message = '')
* @method static void nullOrThrows($expression, $class = 'Exception', $message = '')
* @method static void allString($values, $message = '')
* @method static void allStringNotEmpty($values, $message = '')
* @method static void allInteger($values, $message = '')
* @method static void allIntegerish($values, $message = '')
* @method static void allFloat($values, $message = '')
* @method static void allNumeric($values, $message = '')
* @method static void allNatural($values, $message = '')
* @method static void allBoolean($values, $message = '')
* @method static void allScalar($values, $message = '')
* @method static void allObject($values, $message = '')
* @method static void allResource($values, $type = null, $message = '')
* @method static void allIsCallable($values, $message = '')
* @method static void allIsArray($values, $message = '')
* @method static void allIsTraversable($values, $message = '')
* @method static void allIsArrayAccessible($values, $message = '')
* @method static void allIsCountable($values, $message = '')
* @method static void allIsIterable($values, $message = '')
* @method static void allIsInstanceOf($values, $class, $message = '')
* @method static void allNotInstanceOf($values, $class, $message = '')
* @method static void allIsInstanceOfAny($values, $classes, $message = '')
* @method static void allIsAOf($values, $class, $message = '')
* @method static void allIsAnyOf($values, $class, $message = '')
* @method static void allIsNotA($values, $class, $message = '')
* @method static void allNull($values, $message = '')
* @method static void allNotNull($values, $message = '')
* @method static void allIsEmpty($values, $message = '')
* @method static void allNotEmpty($values, $message = '')
* @method static void allTrue($values, $message = '')
* @method static void allFalse($values, $message = '')
* @method static void allNotFalse($values, $message = '')
* @method static void allIp($values, $message = '')
* @method static void allIpv4($values, $message = '')
* @method static void allIpv6($values, $message = '')
* @method static void allEmail($values, $message = '')
* @method static void allUniqueValues($values, $message = '')
* @method static void allEq($values, $expect, $message = '')
* @method static void allNotEq($values, $expect, $message = '')
* @method static void allSame($values, $expect, $message = '')
* @method static void allNotSame($values, $expect, $message = '')
* @method static void allGreaterThan($values, $limit, $message = '')
* @method static void allGreaterThanEq($values, $limit, $message = '')
* @method static void allLessThan($values, $limit, $message = '')
* @method static void allLessThanEq($values, $limit, $message = '')
* @method static void allRange($values, $min, $max, $message = '')
* @method static void allOneOf($values, $values, $message = '')
* @method static void allInArray($values, $values, $message = '')
* @method static void allContains($values, $subString, $message = '')
* @method static void allNotContains($values, $subString, $message = '')
* @method static void allNotWhitespaceOnly($values, $message = '')
* @method static void allStartsWith($values, $prefix, $message = '')
* @method static void allNotStartsWith($values, $prefix, $message = '')
* @method static void allStartsWithLetter($values, $message = '')
* @method static void allEndsWith($values, $suffix, $message = '')
* @method static void allNotEndsWith($values, $suffix, $message = '')
* @method static void allRegex($values, $pattern, $message = '')
* @method static void allNotRegex($values, $pattern, $message = '')
* @method static void allUnicodeLetters($values, $message = '')
* @method static void allAlpha($values, $message = '')
* @method static void allDigits($values, $message = '')
* @method static void allAlnum($values, $message = '')
* @method static void allLower($values, $message = '')
* @method static void allUpper($values, $message = '')
* @method static void allLength($values, $length, $message = '')
* @method static void allMinLength($values, $min, $message = '')
* @method static void allMaxLength($values, $max, $message = '')
* @method static void allLengthBetween($values, $min, $max, $message = '')
* @method static void allFileExists($values, $message = '')
* @method static void allFile($values, $message = '')
* @method static void allDirectory($values, $message = '')
* @method static void allReadable($values, $message = '')
* @method static void allWritable($values, $message = '')
* @method static void allClassExists($values, $message = '')
* @method static void allSubclassOf($values, $class, $message = '')
* @method static void allInterfaceExists($values, $message = '')
* @method static void allImplementsInterface($values, $interface, $message = '')
* @method static void allPropertyExists($values, $property, $message = '')
* @method static void allPropertyNotExists($values, $property, $message = '')
* @method static void allMethodExists($values, $method, $message = '')
* @method static void allMethodNotExists($values, $method, $message = '')
* @method static void allKeyExists($values, $key, $message = '')
* @method static void allKeyNotExists($values, $key, $message = '')
* @method static void allValidArrayKey($values, $message = '')
* @method static void allCount($values, $key, $message = '')
* @method static void allMinCount($values, $min, $message = '')
* @method static void allMaxCount($values, $max, $message = '')
* @method static void allCountBetween($values, $min, $max, $message = '')
* @method static void allIsList($values, $message = '')
* @method static void allIsNonEmptyList($values, $message = '')
* @method static void allIsMap($values, $message = '')
* @method static void allIsNonEmptyMap($values, $message = '')
* @method static void allUuid($values, $message = '')
* @method static void allThrows($expressions, $class = 'Exception', $message = '')
* @mixin Mixin
*
* @since 1.0
*
@@ -237,8 +56,7 @@ class Assert
/**
* @psalm-pure
* @psalm-assert string $value
* @psalm-assert !empty $value
* @psalm-assert non-empty-string $value
*
* @param mixed $value
* @param string $message
@@ -340,7 +158,7 @@ class Assert
{
if (!\is_int($value) || $value < 0) {
static::reportInvalidArgument(\sprintf(
$message ?: 'Expected a non-negative integer. Got %s',
$message ?: 'Expected a non-negative integer. Got: %s',
static::valueToString($value)
));
}
@@ -823,6 +641,7 @@ class Assert
}
/**
* @psalm-pure
* @psalm-assert !false $value
*
* @param mixed $value
@@ -881,7 +700,7 @@ class Assert
{
if (false === \filter_var($value, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) {
static::reportInvalidArgument(\sprintf(
$message ?: 'Expected a value to be an IPv6. Got %s',
$message ?: 'Expected a value to be an IPv6. Got: %s',
static::valueToString($value)
));
}
@@ -897,7 +716,7 @@ class Assert
{
if (false === \filter_var($value, FILTER_VALIDATE_EMAIL)) {
static::reportInvalidArgument(\sprintf(
$message ?: 'Expected a value to be a valid e-mail address. Got %s',
$message ?: 'Expected a value to be a valid e-mail address. Got: %s',
static::valueToString($value)
));
}
@@ -1668,6 +1487,8 @@ class Assert
}
/**
* @psalm-assert class-string $value
*
* @param mixed $value
* @param string $message
*
@@ -1707,6 +1528,8 @@ class Assert
}
/**
* @psalm-assert class-string $value
*
* @param mixed $value
* @param string $message
*
@@ -1990,8 +1813,7 @@ class Assert
/**
* @psalm-pure
* @psalm-assert list $array
* @psalm-assert !empty $array
* @psalm-assert non-empty-list $array
*
* @param mixed $array
* @param string $message
@@ -2072,7 +1894,7 @@ class Assert
}
/**
* @psalm-param class-string<Throwable>
* @psalm-param class-string<Throwable> $class
*
* @param Closure $expression
* @param string $class

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +0,0 @@
#!/usr/bin/with-contenv bash
exec supervisord --nodaemon --configuration /etc/supervisord.conf