aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/vendor/php81_bc/strftime/src/AbstractLocaleFormatter.php
blob: bd9b43bcdfad624a723a22d8fdbeec0fba28d848 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

namespace PHP81_BC\strftime;

use DateTimeInterface;

abstract class AbstractLocaleFormatter {

  protected $locale;

  /**
   * Constructor
   *
   * @param string $locale The locale to use when formatting
   */
  public function __construct($locale)
  {
    $this->locale = $locale;
  }

  /**
   * Format the given local dependent placeholder
   *
   * @param DateTimeInterface $timestamp
   * @param string $format The strftime compatible, locale dependend placeholder
   * @throws \RuntimeException when the given place holder is unknown
   * @return false|string
   */
  abstract public function __invoke(DateTimeInterface $timestamp, string $format);

}