Download the PHP package oceanmoon/core without Composer

On this page you can find all versions of the php package oceanmoon/core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package core

OceanMoon PHP Core

A general purpose package containing core PHP utility classes and methods for use by other OceanMoon PHP packages.

Documentation


Description

This package provides a comprehensive set of utility classes for working with various PHP types and common operations. Most utility classes are final with static methods and cannot be instantiated directly. Console is the exception — an instantiable class with instance methods and internal style state, since its fluent -> chaining API needs a real object to chain off.


Development and Quality Assurance

Claude Chat and Claude Code were used in the development of this package. The core classes were designed, coded, and commented primarily by the author, with Claude providing substantial assistance with code review, suggesting improvements, debugging, and generating tests and documentation.

All code was thoroughly reviewed by the author, and validated using industry-standard tools including PHP_Codesniffer, PHPStan (to level 9), and PHPUnit to ensure full compliance with PSR-12 coding standards and comprehensive unit testing with 100% code coverage.

This collaborative approach has produced a well-designed, production-ready package with thorough test coverage and documentation.

Code Coverage


Requirements


Installation


Classes

Floats

Float-specific utilities for handling IEEE-754 special values (-0.0, ±INF, NAN), approximate comparison, float space navigation (next/previous), random generation, and IEEE-754 component assembly/disassembly.

Integers

Integer arithmetic operations with overflow checking (add, subtract, multiply, power), GCD calculation, and Unicode subscript/superscript conversion.

Numbers

Number-related utilities for type checking (distinguishing actual numbers from numeric strings), exact equality that correctly handles mixed int/float comparisons, and sign operations with IEEE-754 signed zero support.

Arrays

Array utility methods including circular reference detection, value quoting, and first/last element extraction.

Types

Type checking and inspection utilities with methods for identifying numbers, unsigned integers, traits, and generating unique string keys.

Stringify

Advanced value-to-string conversion with pretty printing, supporting all PHP types with improved readability. This class serves as the basis of the Console::dump() method.

Environment

Runtime environment detection: 64-bit architecture checks, and locale detection from the HTTP Accept-Language header.

Console

ANSI/SGR-styled console output: 16-color foreground/background, text attributes (bold, italic, underline, etc.), method chaining, style snapshot/restore, and higher-level helpers like dump() and severity-colored messages (success(), error(), warn(), info()).


Globals

Useful constants (M_TAU, RECURSION) that are more convenient to use as globals (namespaced to OceanMoon\Core) than as class members.


Traits

Comparison Traits

Equality and ordering comparison operations for custom types. See ComparisonTraits.md for the trait hierarchy and usage guide.

Trait Description
Equatable Base trait for exact equality comparison via equal().
Comparable Extends Equatable with ordering: lessThan(), greaterThan(), etc.
ApproxEquatable Extends Equatable with tolerance-based approxEqual().
ApproxComparable Combines Comparable and ApproxEquatable with approxCompare().

Assert Traits

Custom PHPUnit assertions for test cases. See TestingTraits.md for usage examples.

Trait Description
FloatAssertions Provides assertApproxEqual() with informative failure messages.

Enums

FloatFormat

Notation styles for Floats::format() — fixed-point, scientific, or automatic selection between the two.

ExponentFormat

Rendering styles for the exponent portion of scientific-notation float output, from plain ASCII e/E through to Unicode and HTML mathematical notation.


Exceptions

FormatException

Exception thrown when a string has an invalid format for the desired operation. Extends DomainException. Useful for parse methods or constructors that accept string arguments.

ArithmeticException

Exception thrown when an arithmetic operation has no defined result for the given operands, such as division by zero or a logarithm of a non-positive number. Extends DomainException. Displaces DivisionByZeroError for userland arithmetic code in value types like Complex, Rational, Vector, and Matrix.


Testing

The library includes comprehensive test coverage:


License

MIT License - see LICENSE for details


Support

For questions or suggestions, please open an issue.


Changelog

See CHANGELOG.md for version history and changes.


All versions of core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package oceanmoon/core contains the following files

Loading the files please wait ...