项目作者: christopher-evans

项目描述 :
PHP logger supporting multiple targets.
高级语言: PHP
项目地址: git://github.com/christopher-evans/log.git
创建时间: 2017-04-08T00:34:45Z
项目社区:https://github.com/christopher-evans/log

开源协议:MIT License

下载


West Log

Master

Build Status
Coverage Status
Maintainability

Autoloading

This package is PSR-4 autoloadable via composer or otherwise mapping the West\Log
namespace to the src/ directory. To run the tests the West\Log namespace should map
to the tests/ directory.

Dependencies

This package requires PHP 7.0 or later; interfaces required by the package are
documented in the composer.json file.

Code Quality

To run the unit tests and generate a coverage report with PHPUnit run
composer install followed by composer test at the command line.

This package should comply with the recommendations set out in PSR-1, PSR-2
and PSR-4.

To run the benchmarks and generate a report with PHPBench run composer install
followed by composer benchmark at the command line. For details about the
reports see the the composer.json file and the PHPBenchDocs.

Documentation

This package is documented here. To generate the docs run
run composer install --no-dev, ensure MkDocs is installed and available
as doxygen and run composer docs.

Principles

The aim of this package is to implement some of the principles of object oriented programming described in David West’s
Object Thinking. Many of the ideas come from Yegor Bugayenko‘s writings about West’s book, and Alan Kay‘s
comments on Squeak and Smalltalk. In particular:

  • Everything is an object.

    Some exceptions are permitted, for example the introduction of resources to compensate
    for the lack of OOP in earlier versions of the language, are allowed.

  • An object exists in real life.

  • Objects interact through interfaces.

    Objects judge objects based on what they do, not what they are. A public method not documented by an interface would
    be redundant.

  • An object is unique.

    Some exceptions are permitted, for example two objects encapsulating distinct URIs may point to the same resource
    without aggressive URI normalization.

  • An object is immutable.

    Various definitions of immutability can be contended, e.g. a file object representing a file in a mutable filesystem
    is considered mutable regardless of whether an changes to the file are visible through the object.

  • A class name does not end in ‘-er’.

    An object is a thing, and a class name described what objects of that class are, not what they do. Verbs are used for
    method names.

  • There are no null values.

    The special value null is not an instance of any class, and does not implement any (useful) interface. An object
    that does not implement the interfaces expected of it’s class does not exist. One exception is permitted: PHP only
    allows null to be used as the default value for an argument type-hinted as a class; in this case a null default value
    may be used. This allows multiple method signatures without duplicating code.

  • A class does not have any static properties or methods.

    An application consists of objects interacting through interfaces, and classes are used to describe sets of objects,
    not to implement logic for those objects.

  • A class is final.

    An object manages it’s own internal behavior, and works with other objects only through it’s public interface.
    Extending a completed class may break the logic of the parent class.

  • No getters and setters.

    Objects are defined by their behavior, not by their attributes. Getters and setters are a shallow way of imitating
    data-based design as if it were a behavior of an object.