Skip to content

Commit 2762244

Browse files
committed
move to nette/utils
1 parent 1733257 commit 2762244

17 files changed

+7
-931
lines changed

composer.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@
1414
"homepage": "https://nette.org/contributors"
1515
}
1616
],
17-
"require": {
18-
"php": ">=7.1",
19-
"nette/utils": "^2.4 || ^3.0"
20-
},
21-
"require-dev": {
22-
"nette/tester": "^2.0",
23-
"tracy/tracy": "^2.3",
24-
"phpstan/phpstan": "^0.12"
25-
},
26-
"conflict": {
27-
"nette/nette": "<2.2"
28-
},
29-
"autoload": {
30-
"classmap": ["src/"]
31-
},
32-
"minimum-stability": "dev",
33-
"scripts": {
34-
"phpstan": "phpstan analyse",
35-
"tester": "tester tests -s"
36-
},
3717
"extra": {
3818
"branch-alias": {
3919
"dev-master": "3.0-dev"

phpstan.neon

Lines changed: 0 additions & 5 deletions
This file was deleted.

readme.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
Nette Finder: Files Searching
22
=============================
33

4-
[![Downloads this Month](https://img.shields.io/packagist/dm/nette/finder.svg)](https://packagist.org/packages/nette/finder)
5-
[![Tests](https://github.com/nette/finder/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/finder/actions)
6-
[![Coverage Status](https://coveralls.io/repos/github/nette/finder/badge.svg?branch=master)](https://coveralls.io/github/nette/finder?branch=master)
7-
[![Latest Stable Version](https://poser.pugx.org/nette/finder/v/stable)](https://github.com/nette/finder/releases)
8-
[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/nette/finder/blob/master/license.md)
9-
10-
11-
Introduction
12-
------------
13-
144
Nette Finder makes browsing the directory structure really easy.
155

166
Documentation can be found on the [website](https://doc.nette.org/finder).
177

8+
**The library has been moved to the [nette/utils](https://github.com/nette/utils)**
9+
1810

1911
[Support Me](https://github.com/sponsors/dg)
2012
--------------------------------------------
@@ -30,7 +22,7 @@ Installation
3022
------------
3123

3224
```shell
33-
composer require nette/finder
25+
composer require nette/utils
3426
```
3527

3628
All examples assume the following class alias is defined:
@@ -48,11 +40,11 @@ How to find all `*.txt` files in `$dir` directory and all its subdirectories?
4840
```php
4941
foreach (Finder::findFiles('*.txt')->from($dir) as $key => $file) {
5042
// $key is a string containing absolute filename with path
51-
// $file is an instance of SplFileInfo
43+
// $file is an instance of Nette\Utils\FileInfo
5244
}
5345
```
5446

55-
The files in the `$file` variable are instances of the `SplFileInfo` class.
47+
The files in the `$file` variable are instances of the `Nette\Utils\FileInfo` class.
5648

5749
If the directory does not exist, an `Nette\UnexpectedValueException` is thrown.
5850

@@ -113,7 +105,7 @@ Finder::findFiles('*.txt')
113105
->exclude('*X*')
114106
```
115107

116-
If `exclude()` is specified **after** `from()`, it applies to crawled subdirectories:
108+
And use `exclude()` to skip crawled subdirectories:
117109

118110
```php
119111
Finder::findFiles('*.php')
@@ -148,7 +140,7 @@ Both functions understand the operators `>`, `>=`, `<`, `<=`, `=`, `!=`.
148140
Here we traverse PHP files with number of lines greater than 1000. As a filter we use a custom callback:
149141

150142
```php
151-
$hasMoreThan100Lines = function (SplFileInfo $file): bool {
143+
$hasMoreThan100Lines = function (FileInfo $file): bool {
152144
return count(file($file->getPathname())) > 1000;
153145
};
154146

0 commit comments

Comments
 (0)