Skip to content

Commit 19b5ed7

Browse files
author
Phil Sturgeon
committed
No more Foo/Bar examples
Acme\Log is a little more friendly
1 parent bc85cdc commit 19b5ed7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

proposed/psr-4-autoloader/psr-4-autoloader.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,30 @@ for autoloader interoperability, by mapping namespaces to file system paths.
2323
separator.
2424

2525
- **Namespace Name**: Given a "fully qualified class name" of
26-
`Foo\Bar\Baz\Qux`, the "namespace names" are `Foo`, `Bar`, and `Baz`. A
26+
`Acme\Log\Formatter\LineFormatter`, the "namespace names" are `Acme`, `Log`, and `Formatter`. A
2727
namespace name MUST NOT include a leading or trailing namespace separator.
2828

2929
- **Namespace Prefix**: Given a "fully qualified class name" of
30-
`Foo\Bar\Baz\Qux`, the "namespace prefix" could be `Foo\`, `Foo\Bar\`, or
31-
`Foo\Bar\Baz\`. The "namespace prefix" MUST NOT include a leading namespace
30+
`Acme\Log\Formatter\LineFormatter`, the "namespace prefix" could be `Acme\`, `Acme\Log\`, or
31+
`Acme\Log\Formatter\`. The "namespace prefix" MUST NOT include a leading namespace
3232
separator, but MUST include a trailing namespace separator.
3333

3434
- **Relative Class Name**: The parts of the "fully qualified class name" that
3535
appear after the "namespace prefix". Given a "fully qualified class name" of
36-
`Foo\Bar\Baz\Qux` and a "namespace prefix" of `Foo\Bar\`, the "relative
37-
class name" is `Baz\Qux`. The "relative class name" MUST NOT include a
36+
`Acme\Log\Formatter\LineFormatter` and a "namespace prefix" of `Acme\Log\`, the "relative
37+
class name" is `Formatter\LineFormatter`. The "relative class name" MUST NOT include a
3838
leading namespace separator.
3939

4040
- **Base Directory**: The directory path in the file system where the files
4141
for "relative class names" have their root. Given a namespace prefix of
42-
`Foo\Bar\`, the "base directory" could be `./src/`.
42+
`Acme\Log\`, the "base directory" could be `./src/`.
4343
The "base directory" MUST include a trailing directory separator.
4444

4545
- **Mapped File Name**: The path in the file system resulting from the
4646
transformation of a "fully qualified class name". Given a "fully qualified
47-
class name" of `Foo\Bar\Baz\Qux`, a namespace prefix of `Foo\Bar\`, and a
47+
class name" of `Acme\Log\Formatter\LineFormatter`, a namespace prefix of `Acme\Log\`, and a
4848
"base directory" of `./src/`, the "mapped file name"
49-
MUST be `./src/Baz/Qux.php`.
49+
MUST be `./src/Formatter/LineFormatter.php`.
5050

5151

5252
3. Specification
@@ -68,17 +68,17 @@ for autoloader interoperability, by mapping namespaces to file system paths.
6868
MAY be followed by one or more additional namespace names, and MUST end in
6969
a class name.
7070

71-
> **Example:** With a "fully qualified class name" of `Foo\Bar\Baz`,
72-
> the "namespace name is `Foo\Bar` and the class name is `Baz`.
71+
> **Example:** With a "fully qualified class name" of `Acme\Log\Baz`,
72+
> the "namespace name is `Acme\Log` and the class name is `Baz`.
7373
7474
6. A "namespace prefix" MUST correspond to at least one "base directory".
7575

7676
> **Example:** Any one of these examples would be valid if used
7777
> individually:
7878
>
79-
> * \Foo\Bar -> ./
80-
> * \Foo\Bar -> ./src/
81-
> * \Foo\Bar -> ./src/bar/
79+
> * \Acme\Log -> ./
80+
> * \Acme\Log -> ./src/
81+
> * \Acme\Log -> ./src/foo/
8282
8383
7. A "namespace prefix" MAY correspond to more than one "base directory". The
8484
order in which an autoloader will attempt to map the file is not in the scope

0 commit comments

Comments
 (0)