Skip to content

Commit a56b5f3

Browse files
committed
docs: break long lines
1 parent a0a5c8e commit a56b5f3

1 file changed

Lines changed: 32 additions & 23 deletions

File tree

user_guide_src/source/libraries/file_collections.rst

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
File Collections
33
################
44

5-
Working with groups of files can be cumbersome, so the framework supplies the ``FileCollection`` class to facilitate
6-
locating and working with groups of files across the filesystem.
5+
Working with groups of files can be cumbersome, so the framework supplies the
6+
``FileCollection`` class to facilitate locating and working with groups of files
7+
across the filesystem.
78

89
.. contents::
910
:local:
@@ -18,13 +19,15 @@ of files you set or build:
1819

1920
.. literalinclude:: files/011.php
2021

21-
After you have input the files you would like to work with you may remove files or use the filtering commands to remove
22-
or retain files matching a certain regex or glob-style pattern:
22+
After you have input the files you would like to work with you may remove files
23+
or use the filtering commands to remove or retain files matching a certain regex
24+
or glob-style pattern:
2325

2426
.. literalinclude:: files/012.php
2527

26-
When your collection is complete, you can use ``get()`` to retrieve the final list of file paths, or take advantage of
27-
``FileCollection`` being countable and iterable to work directly with each ``File``:
28+
When your collection is complete, you can use ``get()`` to retrieve the final
29+
list of file paths, or take advantage of ``FileCollection`` being countable and
30+
iterable to work directly with each ``File``:
2831

2932
.. literalinclude:: files/013.php
3033

@@ -37,14 +40,16 @@ Starting a Collection
3740
__construct(string[] $files = [])
3841
=================================
3942

40-
The constructor accepts an optional array of file paths to use as the initial collection. These are passed to
41-
``add()`` so any files supplied by child classes in the ``$files`` will remain.
43+
The constructor accepts an optional array of file paths to use as the initial
44+
collection. These are passed to ``add()`` so any files supplied by child classes
45+
in the ``$files`` will remain.
4246

4347
define()
4448
========
4549

46-
Allows child classes to define their own initial files. This method is called by the constructor and allows
47-
predefined collections without having to use their methods.
50+
Allows child classes to define their own initial files. This method is called by
51+
the constructor and allows predefined collections without having to use their
52+
methods.
4853

4954
Example:
5055

@@ -57,8 +62,9 @@ every time.
5762
set(array $files)
5863
=================
5964

60-
Sets the list of input files to the provided string array of file paths. This will remove any existing
61-
files from the collection, so ``$collection->set([])`` is essentially a hard reset.
65+
Sets the list of input files to the provided string array of file paths. This
66+
will remove any existing files from the collection, so ``$collection->set([])``
67+
is essentially a hard reset.
6268

6369
***************
6470
Inputting Files
@@ -67,13 +73,14 @@ Inputting Files
6773
add(string[]|string $paths, bool $recursive = true)
6874
===================================================
6975

70-
Adds all files indicated by the path or array of paths. If the path resolves to a directory then ``$recursive``
71-
will include sub-directories.
76+
Adds all files indicated by the path or array of paths. If the path resolves to
77+
a directory then ``$recursive`` will include sub-directories.
7278

7379
addFile(string $file) / addFiles(array $files)
7480
==============================================
7581

76-
Adds the file or files to the current list of input files. Files are absolute paths to actual files.
82+
Adds the file or files to the current list of input files. Files are absolute
83+
paths to actual files.
7784

7885
removeFile(string $file) / removeFiles(array $files)
7986
====================================================
@@ -85,8 +92,8 @@ addDirectory(string $directory, bool $recursive = false)
8592
addDirectories(array $directories, bool $recursive = false)
8693
===========================================================
8794

88-
Adds all files from the directory or directories, optionally recursing into sub-directories. Directories are
89-
absolute paths to actual directories.
95+
Adds all files from the directory or directories, optionally recursing into
96+
sub-directories. Directories are absolute paths to actual directories.
9097

9198
***************
9299
Filtering Files
@@ -97,11 +104,12 @@ removePattern(string $pattern, string $scope = null)
97104
retainPattern(string $pattern, string $scope = null)
98105
====================================================
99106

100-
Filters the current file list through the pattern (and optional scope), removing or retaining matched
101-
files. ``$pattern`` may be a complete regex (like ``'#[A-Za-z]+\.php#'``) or a pseudo-regex similar
102-
to ``glob()`` (like ``*.css``).
103-
If a ``$scope`` is provided then only files in or under that directory will be considered (i.e. files
104-
outside of ``$scope`` are always retained). When no scope is provided then all files are subject.
107+
Filters the current file list through the pattern (and optional scope), removing
108+
or retaining matched files. ``$pattern`` may be a complete regex (like ``'#[A-Za-z]+\.php#'``)
109+
or a pseudo-regex similar to ``glob()`` (like ``*.css``). If a ``$scope`` is
110+
provided then only files in or under that directory will be considered (i.e. files
111+
outside of ``$scope`` are always retained). When no scope is provided then all
112+
files are subject.
105113

106114
Examples:
107115

@@ -116,4 +124,5 @@ get(): string[]
116124

117125
Returns an array of all the loaded input files.
118126

119-
.. note:: ``FileCollection`` is an ``IteratorAggregate`` so you can work with it directly (e.g. ``foreach ($collection as $file)``).
127+
.. note:: ``FileCollection`` is an ``IteratorAggregate`` so you can work with it
128+
directly (e.g. ``foreach ($collection as $file)``).

0 commit comments

Comments
 (0)