PHPackages                             letraceursnork/copyright-year-range - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. letraceursnork/copyright-year-range

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

letraceursnork/copyright-year-range
===================================

Lightweight PHP library to generate dynamic copyright year ranges

v1.0.0(11mo ago)0312[1 PRs](https://github.com/LeTraceurSnork/copyright-year-range/pulls)MITPHPCI failing

Since May 27Pushed 11mo agoCompare

[ Source](https://github.com/LeTraceurSnork/copyright-year-range)[ Packagist](https://packagist.org/packages/letraceursnork/copyright-year-range)[ RSS](/packages/letraceursnork-copyright-year-range/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Copyright Year Range Helper
===========================

[](#copyright-year-range-helper)

[![Coverage Status](https://camo.githubusercontent.com/390e4c4f4400d5c2d715faf25115c3b6d08f91b4891b57c3f9086e7d0f034f98/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4c6554726163657572536e6f726b2f636f707972696768742d796561722d72616e67652f62616467652e737667)](https://coveralls.io/github/LeTraceurSnork/copyright-year-range)

A simple PHP utility for generating dynamic copyright year ranges in your projects.

Quick installation
------------------

[](#quick-installation)

```
composer require letraceursnork/copyright-year-range
```

Purpose
-------

[](#purpose)

This package provides an easy way to format copyright years, automatically handling cases where the start year matches the current year. Instead of hardcoding dates like © 2020 - 2025, you can generate them dynamically, ensuring your copyright notices stay up to date. Forget about `if`s like this:

```
if ($year !== '2024') { // The year that copyright starts
    echo "© 2024 - $year"
} else {
    echo "© $year";
}
```

Just use this:

```
echo CopyrightHelper::getCopyrightString(2020); // Output: "2020 - 2025" (if current year is 2025)
echo CopyrightHelper::getCopyrightString(2025); // Output: "2025" (if current year is 2025)
```

Custom formatting
-----------------

[](#custom-formatting)

```
CopyrightHelper::setFormat('%1$s – %2$s'); // Using an en dash
echo CopyrightHelper::getCopyrightString(2020); // "2020 – 2023"

CopyrightHelper::setFormat('%1$s  %2$s');
echo CopyrightHelper::getCopyrightString(2020); // "2020  2023"
```

Perfect For
-----------

[](#perfect-for)

- Websites &amp; web applications
- Open-source projects
- Documentation footers
- Automatically updating copyright notices

Keep your copyright notices fresh with zero maintenance! 🚀

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance50

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8626d285a2c7ac7cd4f72d196cf4b3685f214bf3561faaa9be4596c21ed95db7?d=identicon)[LeTraceurSnork](/maintainers/LeTraceurSnork)

---

Top Contributors

[![LeTraceurSnork](https://avatars.githubusercontent.com/u/11344267?v=4)](https://github.com/LeTraceurSnork "LeTraceurSnork (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/letraceursnork-copyright-year-range/health.svg)

```
[![Health](https://phpackages.com/badges/letraceursnork-copyright-year-range/health.svg)](https://phpackages.com/packages/letraceursnork-copyright-year-range)
```

###  Alternatives

[xodigital/formerly

Craft Plugin that allows users to build their own forms and view form submissions

582.1k](/packages/xodigital-formerly)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
