Skip to content

Commit bd6c62f

Browse files
committed
Only support PHP 7.4 add declare_strict=1 to all files
1 parent edcc239 commit bd6c62f

File tree

186 files changed

+208
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+208
-78
lines changed

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ language: php
22
env:
33
- SKIP_TEST=1
44
php:
5-
- 7.2
6-
- 7.3
75
- 7.4
86

97
before_script:

Dockerfile71

-17
This file was deleted.

Dockerfile72

-16
This file was deleted.

Dockerfile73

-16
This file was deleted.

Dockerfile74

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM php:7.4-cli
22

33
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends git zip
4+
apt-get install -y --no-install-recommends zip libzip-dev && \
5+
docker-php-ext-install zip
56

67
RUN curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
78

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"files": ["tests/TestBaseCase.php"]
2121
},
2222
"require" : {
23-
"php": ">=7.1",
23+
"php": "~7.4",
2424
"yooper/stop-words": "~1",
25-
"symfony/console": "~4.0 || ~5.0",
25+
"symfony/console": ">= 4.4",
2626
"wamania/php-stemmer": "~1",
2727
"yooper/nicknames": "~1",
28-
"vanderlee/php-sentence": "~1.0"
28+
"vanderlee/php-sentence": "~1"
2929
},
3030
"require-dev": {
31-
"phpunit/phpunit": "^8",
31+
"phpunit/phpunit": "^9",
3232
"mockery/mockery" : "^1"
3333
}
3434
}

src/Adapters/ArrayDataReaderAdapter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Adapters;
34
use TextAnalysis\Interfaces\IDataReader;
45
/**

src/Adapters/EnchantAdapter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Adapters;
45

src/Adapters/JsonDataAdapter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Adapters;
34
use TextAnalysis\Interfaces\IDataReader;
45
/**

src/Adapters/JsonWriterAdapter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Adapters;
34
use TextAnalysis\Interfaces\IDataWriter;
45

src/Adapters/PspellAdapter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Adapters;
45

src/Analysis/DateAnalysis.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Analysis;
45

src/Analysis/FreqDist.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Analysis;
34

45
use TextAnalysis\Exceptions\InvalidParameterSizeException;

src/Analysis/Keywords/Rake.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Analysis\Keywords;
45

src/Analysis/Summarize/Simple.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Analysis\Summarize;
45

src/Classifiers/NaiveBayes.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Classifiers;
45

src/Collections/DocumentArrayCollection.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Collections;
45
use TextAnalysis\Interfaces\ICollection;

src/Collocations/CollocationFinder.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Collocations;
45

src/Comparisons/CosineSimilarityComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Comparisons/HammingDistanceComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Comparisons/JaccardIndexComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Comparisons/JaroWinklerComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Comparisons/LevenshteinComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Comparisons/LongestCommonSubstringComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Comparisons/MostFreqCharComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Comparisons/SimilarTextComparison.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Comparisons;
45

src/Console/Commands/NltkPackageInstallAllCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Console\Commands;
45

src/Console/Commands/NltkPackageInstallCommand.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Console\Commands;
45

@@ -68,7 +69,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6869
$context = stream_context_create([], ['notification' => [$this, 'progress']]);
6970

7071
// Pipe file.
71-
$resource = fopen($packageFound->getUrl(), 'r', null, $context);
72+
$resource = fopen($packageFound->getUrl(), 'r', false, $context);
7273
$stream = fopen($download->getDownloadFullPath(), 'w+');
7374
if (!$stream) {
7475
$output->writeln("Package {$packageFound->getId()} - {$packageFound->getName()} install failed, permission denied to create file into {$download->getDownloadFullPath()}");

src/Console/Commands/NltkPackageListCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Console\Commands;
45

src/Console/Commands/StopWordsCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Console\Commands;
45

src/Console/Commands/VocabSizeCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Console\Commands;
45

src/Corpus/ImportCorpus.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Corpus;
45

src/Corpus/NameCorpus.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Corpus;
45

src/Corpus/ReadCorpusAbstract.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Corpus;
45

src/Corpus/TextCorpus.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Corpus;
45

@@ -56,7 +57,7 @@ public function getDispersion(array $needles) : array
5657
$found = array_fill_keys($needles, []);
5758
foreach(array_keys($needles) as $needle)
5859
{
59-
$found[$needle] = $this->findAll($needle);
60+
$found[$needle] = $this->findAll((string)$needle);
6061
}
6162
return $found;
6263
}

src/Corpus/WordnetCorpus.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Corpus;
45

src/Documents/ContentDocument.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Documents;
45

src/Documents/DocumentAbstract.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Documents;
34
use TextAnalysis\Interfaces\ITokenTransformation;
45
/**

src/Documents/TokensDocument.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Documents;
34

45
use TextAnalysis\Interfaces\ITokenTransformation;

src/Downloaders/DownloadPackageFactory.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Downloaders;
34

45
use TextAnalysis\Utilities\Nltk\Download\Package;

src/Downloaders/NltkCorporaIndexDownloader.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Downloaders;
45

src/Exceptions/InvalidExpression.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Exceptions;
34

45
/**

src/Exceptions/InvalidParameterSizeException.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Exceptions;
45

src/Extracts/DateExtract.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Extracts;
34

45
use TextAnalysis\Interfaces\IExtractStrategy;

src/Extracts/EmailExtract.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Extracts;
45

src/Extracts/HashTag.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Extracts;
45
use TextAnalysis\Interfaces\IExtractStrategy;

src/Extracts/LambdaExtract.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Extracts;
45
use TextAnalysis\Interfaces\IExtractStrategy;

src/Extracts/UrlExtract.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Extracts;
45

src/Filters/CharFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Filters;
45

src/Filters/DomainFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Filters;
45

src/Filters/EmailFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Filters;
34

45
use TextAnalysis\Interfaces\ITokenTransformation;

src/Filters/LambdaFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Filters;
34

45
use TextAnalysis\Interfaces\ITokenTransformation;

src/Filters/LowerCaseFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23
namespace TextAnalysis\Filters;
34

45
use TextAnalysis\Interfaces\ITokenTransformation;

src/Filters/NumbersFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types = 1);
23

34
namespace TextAnalysis\Filters;
45

0 commit comments

Comments
 (0)