💦 FULL SET: Changeset/ - HD Photos!

Changeset 2906632


Ignore:
Timestamp:
05/01/2023 05:02:42 PM (3 years ago)
Author:
wpscholar
Message:

Update to version 1.1.4 from GitHub

Location:
mpress-hide-from-search
Files:
10 added
34 edited
1 copied

Legend:

Unmodified
Added
Removed
  • mpress-hide-from-search/tags/1.1.4/includes/MetaBox.php

    r2328021 r2906632  
    2626            add_meta_box(
    2727                'hide-from-search',
    28                 esc_html__( 'Hide from Search', 'hide-from-search' ),
     28                esc_html__( 'Hide from Search', 'mpress-hide-from-search' ),
    2929                array( __CLASS__, 'render' ),
    3030                $post_type,
  • mpress-hide-from-search/tags/1.1.4/includes/Plugin.php

    r2531747 r2906632  
    117117            array(
    118118                'type'              => 'boolean',
    119                 'description'       => esc_html__( 'Hide from WordPress search', 'hide-from-search' ),
     119                'description'       => esc_html__( 'Hide from WordPress search', 'mpress-hide-from-search' ),
    120120                'single'            => true,
    121121                'sanitize_callback' => function ( $value ) {
     
    137137            array(
    138138                'type'              => 'boolean',
    139                 'description'       => esc_html__( 'Hide from search engines', 'hide-from-search' ),
     139                'description'       => esc_html__( 'Hide from search engines', 'mpress-hide-from-search' ),
    140140                'single'            => true,
    141141                'sanitize_callback' => function ( $value ) {
  • mpress-hide-from-search/tags/1.1.4/languages/mpress-hide-from-search.pot

    r2286622 r2906632  
    1 # Copyright (C) 2020 Micah Wood
    2 # This file is distributed under the GPL3.
     1# Copyright (C) 2023 Micah Wood
     2# This file is distributed under the GPL V2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Hide from Search 1.0.2\n"
    6 "Report-Msgid-Bugs-To: "
    7 "https://wordpress.org/support/plugin/mpress-hide-from-search\n"
    8 "POT-Creation-Date: 2020-04-19 03:39:51+00:00\n"
    9 "MIME-Version: 1.0\n"
    10 "Content-Type: text/plain; charset=utf-8\n"
    11 "Content-Transfer-Encoding: 8bit\n"
    12 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
     5"Project-Id-Version: Hide from Search 1.1.4\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mpress-hide-from-search\n"
    137"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    148"Language-Team: LANGUAGE <[email protected]>\n"
    15 "X-Generator: node-wp-i18n 1.2.3\n"
     9"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
     11"Content-Transfer-Encoding: 8bit\n"
     12"POT-Creation-Date: \n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.7.1\n"
     15"X-Domain: mpress-hide-from-search\n"
    1616
    17 #. Plugin Name of the plugin/theme
     17#. Plugin Name of the plugin
     18#: includes/MetaBox.php:28
    1819msgid "Hide from Search"
    1920msgstr ""
    2021
    21 #: mpress-hide-from-search.php:104
    22 #. translators: post type
    23 msgid "Hide this %s from WordPress search"
     22#. Plugin URI of the plugin
     23msgid "https://wordpress.org/plugins/mpress-hide-from-search/"
    2424msgstr ""
    2525
    26 #. Plugin URI of the plugin/theme
    27 msgid "https://wpscholar.com/wordpress-plugins/mpress-hide-from-search/"
     26#. Description of the plugin
     27msgid "Hide individual WordPress pages from search engines and/or WordPress search results."
    2828msgstr ""
    2929
    30 #. Description of the plugin/theme
    31 msgid ""
    32 "Hide individual posts, pages and other post types from the default "
    33 "WordPress search functionality."
    34 msgstr ""
    35 
    36 #. Author of the plugin/theme
     30#. Author of the plugin
    3731msgid "Micah Wood"
    3832msgstr ""
    3933
    40 #. Author URI of the plugin/theme
    41 msgid "https://wpscholar.com/"
     34#. Author URI of the plugin
     35msgid "https://wpscholar.com"
    4236msgstr ""
     37
     38#: includes/Plugin.php:119
     39msgid "Hide from WordPress search"
     40msgstr ""
     41
     42#: includes/Plugin.php:139
     43msgid "Hide from search engines"
     44msgstr ""
  • mpress-hide-from-search/tags/1.1.4/mpress-hide-from-search.php

    r2531747 r2906632  
    55 * @package           HideFromSearch
    66 * @author            Micah Wood
    7  * @copyright         Copyright 2020 by Micah Wood - All rights reserved.
     7 * @copyright         Copyright 2020-2023 by Micah Wood - All rights reserved.
    88 * @license           GPL2.0-or-later
    99 *
     
    1212 * Plugin URI:        https://wordpress.org/plugins/mpress-hide-from-search/
    1313 * Description:       Hide individual WordPress pages from search engines and/or WordPress search results.
    14  * Version:           1.1.3
    15  * Requires PHP:      5.6
    16  * Requires at least: 5.0
     14 * Version:           1.1.4
     15 * Requires PHP:      7.4
     16 * Requires at least: 6.0
    1717 * Author:            Micah Wood
    1818 * Author URI:        https://wpscholar.com
     
    2323 */
    2424
    25 define( 'HIDE_FROM_SEARCH_VERSION', '1.1.3' );
     25define( 'HIDE_FROM_SEARCH_VERSION', '1.1.4' );
    2626define( 'HIDE_FROM_SEARCH_FILE', __FILE__ );
    2727
    28 require dirname( __FILE__ ) . '/vendor/autoload.php';
     28require __DIR__ . '/vendor/autoload.php';
    2929
    3030// Check plugin requirements
     
    3333    $plugin_check = new WP_Forge_Plugin_Check( __FILE__ );
    3434
    35     $plugin_check->min_php_version = '5.6';
    36     $plugin_check->min_wp_version  = '5.0';
     35    $plugin_check->min_php_version = '7.4';
     36    $plugin_check->min_wp_version  = '6.0';
    3737    $plugin_check->check_plugin_requirements();
    3838}
    3939
    40 require dirname( __FILE__ ) . '/includes/Plugin.php';
     40require __DIR__ . '/includes/Plugin.php';
  • mpress-hide-from-search/tags/1.1.4/readme.txt

    r2531747 r2906632  
    33Donate link: https://www.paypal.me/wpscholar
    44Tags: search, search engines, WordPress search, hide from search, exclude from search, hide post, hidden posts
    5 Requires at least: 5.0
    6 Requires PHP: 5.6
    7 Tested up to: 5.7
    8 Stable tag: 1.1.3
     5Requires at least: 6.0
     6Requires PHP: 7.4
     7Tested up to: 6.2
     8Stable tag: 1.1.4
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    6767== Changelog ==
    6868
     69= 1.1.4 =
     70* Minor maintenance release
     71
    6972= 1.1.3 =
    7073* Fix PHP notice when Yoast SEO is active
     
    121124== Upgrade Notice ==
    122125
     126= 1.1.4 =
     127* Minor maintenance release
     128
    123129= 1.1.3 =
    124130* Bugfix and security release.
  • mpress-hide-from-search/tags/1.1.4/vendor/autoload.php

    r2531747 r2906632  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc::getLoader();
     25return ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59::getLoader();
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/ClassLoader.php

    r2507158 r2906632  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var ?string */
    4549    private $vendorDir;
    4650
    4751    // PSR-4
     52    /**
     53     * @var array[]
     54     * @psalm-var array<string, array<string, int>>
     55     */
    4856    private $prefixLengthsPsr4 = array();
     57    /**
     58     * @var array[]
     59     * @psalm-var array<string, array<int, string>>
     60     */
    4961    private $prefixDirsPsr4 = array();
     62    /**
     63     * @var array[]
     64     * @psalm-var array<string, string>
     65     */
    5066    private $fallbackDirsPsr4 = array();
    5167
    5268    // PSR-0
     69    /**
     70     * @var array[]
     71     * @psalm-var array<string, array<string, string[]>>
     72     */
    5373    private $prefixesPsr0 = array();
     74    /**
     75     * @var array[]
     76     * @psalm-var array<string, string>
     77     */
    5478    private $fallbackDirsPsr0 = array();
    5579
     80    /** @var bool */
    5681    private $useIncludePath = false;
     82
     83    /**
     84     * @var string[]
     85     * @psalm-var array<string, string>
     86     */
    5787    private $classMap = array();
     88
     89    /** @var bool */
    5890    private $classMapAuthoritative = false;
     91
     92    /**
     93     * @var bool[]
     94     * @psalm-var array<string, bool>
     95     */
    5996    private $missingClasses = array();
     97
     98    /** @var ?string */
    6099    private $apcuPrefix;
    61100
     101    /**
     102     * @var self[]
     103     */
    62104    private static $registeredLoaders = array();
    63105
     106    /**
     107     * @param ?string $vendorDir
     108     */
    64109    public function __construct($vendorDir = null)
    65110    {
    66111        $this->vendorDir = $vendorDir;
    67     }
    68 
     112        self::initializeIncludeClosure();
     113    }
     114
     115    /**
     116     * @return string[]
     117     */
    69118    public function getPrefixes()
    70119    {
     
    76125    }
    77126
     127    /**
     128     * @return array[]
     129     * @psalm-return array<string, array<int, string>>
     130     */
    78131    public function getPrefixesPsr4()
    79132    {
     
    81134    }
    82135
     136    /**
     137     * @return array[]
     138     * @psalm-return array<string, string>
     139     */
    83140    public function getFallbackDirs()
    84141    {
     
    86143    }
    87144
     145    /**
     146     * @return array[]
     147     * @psalm-return array<string, string>
     148     */
    88149    public function getFallbackDirsPsr4()
    89150    {
     
    91152    }
    92153
     154    /**
     155     * @return string[] Array of classname => path
     156     * @psalm-return array<string, string>
     157     */
    93158    public function getClassMap()
    94159    {
     
    97162
    98163    /**
    99      * @param array $classMap Class to filename map
     164     * @param string[] $classMap Class to filename map
     165     * @psalm-param array<string, string> $classMap
     166     *
     167     * @return void
    100168     */
    101169    public function addClassMap(array $classMap)
     
    112180     * appending or prepending to the ones previously set for this prefix.
    113181     *
    114      * @param string       $prefix  The prefix
    115      * @param array|string $paths   The PSR-0 root directories
    116      * @param bool         $prepend Whether to prepend the directories
     182     * @param string          $prefix  The prefix
     183     * @param string[]|string $paths   The PSR-0 root directories
     184     * @param bool            $prepend Whether to prepend the directories
     185     *
     186     * @return void
    117187     */
    118188    public function add($prefix, $paths, $prepend = false)
     
    157227     * appending or prepending to the ones previously set for this namespace.
    158228     *
    159      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    160      * @param array|string $paths   The PSR-4 base directories
    161      * @param bool         $prepend Whether to prepend the directories
     229     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     230     * @param string[]|string $paths   The PSR-4 base directories
     231     * @param bool            $prepend Whether to prepend the directories
    162232     *
    163233     * @throws \InvalidArgumentException
     234     *
     235     * @return void
    164236     */
    165237    public function addPsr4($prefix, $paths, $prepend = false)
     
    205277     * replacing any others previously set for this prefix.
    206278     *
    207      * @param string       $prefix The prefix
    208      * @param array|string $paths  The PSR-0 base directories
     279     * @param string          $prefix The prefix
     280     * @param string[]|string $paths  The PSR-0 base directories
     281     *
     282     * @return void
    209283     */
    210284    public function set($prefix, $paths)
     
    221295     * replacing any others previously set for this namespace.
    222296     *
    223      * @param string       $prefix The prefix/namespace, with trailing '\\'
    224      * @param array|string $paths  The PSR-4 base directories
     297     * @param string          $prefix The prefix/namespace, with trailing '\\'
     298     * @param string[]|string $paths  The PSR-4 base directories
    225299     *
    226300     * @throws \InvalidArgumentException
     301     *
     302     * @return void
    227303     */
    228304    public function setPsr4($prefix, $paths)
     
    244320     *
    245321     * @param bool $useIncludePath
     322     *
     323     * @return void
    246324     */
    247325    public function setUseIncludePath($useIncludePath)
     
    266344     *
    267345     * @param bool $classMapAuthoritative
     346     *
     347     * @return void
    268348     */
    269349    public function setClassMapAuthoritative($classMapAuthoritative)
     
    286366     *
    287367     * @param string|null $apcuPrefix
     368     *
     369     * @return void
    288370     */
    289371    public function setApcuPrefix($apcuPrefix)
     
    306388     *
    307389     * @param bool $prepend Whether to prepend the autoloader or not
     390     *
     391     * @return void
    308392     */
    309393    public function register($prepend = false)
     
    325409    /**
    326410     * Unregisters this instance as an autoloader.
     411     *
     412     * @return void
    327413     */
    328414    public function unregister()
     
    339425     *
    340426     * @param  string    $class The name of the class
    341      * @return bool|null True if loaded, null otherwise
     427     * @return true|null True if loaded, null otherwise
    342428     */
    343429    public function loadClass($class)
    344430    {
    345431        if ($file = $this->findFile($class)) {
    346             includeFile($file);
     432            $includeFile = self::$includeFile;
     433            $includeFile($file);
    347434
    348435            return true;
    349436        }
     437
     438        return null;
    350439    }
    351440
     
    402491    }
    403492
     493    /**
     494     * @param  string       $class
     495     * @param  string       $ext
     496     * @return string|false
     497     */
    404498    private function findFileWithExtension($class, $ext)
    405499    {
     
    467561        return false;
    468562    }
     563
     564    /**
     565     * @return void
     566     */
     567    private static function initializeIncludeClosure()
     568    {
     569        if (self::$includeFile !== null) {
     570            return;
     571        }
     572
     573        /**
     574         * Scope isolated include.
     575         *
     576         * Prevents access to $this/self from included files.
     577         *
     578         * @param  string $file
     579         * @return void
     580         */
     581        self::$includeFile = \Closure::bind(static function($file) {
     582            include $file;
     583        }, null, null);
     584    }
    469585}
    470 
    471 /**
    472  * Scope isolated include.
    473  *
    474  * Prevents access to $this/self from included files.
    475  */
    476 function includeFile($file)
    477 {
    478     include $file;
    479 }
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/InstalledVersions.php

    r2531747 r2906632  
    11<?php
    22
    3 
    4 
    5 
    6 
    7 
    8 
    9 
    10 
    11 
     3/*
     4 * This file is part of Composer.
     5 *
     6 * (c) Nils Adermann <[email protected]>
     7 *     Jordi Boggiano <[email protected]>
     8 *
     9 * For the full copyright and license information, please view the LICENSE
     10 * file that was distributed with this source code.
     11 */
    1212
    1313namespace Composer;
     
    1616use Composer\Semver\VersionParser;
    1717
    18 
    19 
    20 
    21 
    22 
    23 
    24 
     18/**
     19 * This class is copied in every Composer installed project and available to all
     20 *
     21 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
     22 *
     23 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
     26 */
    2527class InstalledVersions
    2628{
    27 private static $installed = array (
    28   'root' =>
    29   array (
    30     'pretty_version' => '1.1.3',
    31     'version' => '1.1.3.0',
    32     'aliases' =>
    33     array (
    34     ),
    35     'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    36     'name' => 'wpscholar/mpress-hide-from-search',
    37   ),
    38   'versions' =>
    39   array (
    40     'psr/container' =>
    41     array (
    42       'pretty_version' => '1.1.1',
    43       'version' => '1.1.1.0',
    44       'aliases' =>
    45       array (
    46       ),
    47       'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
    48     ),
    49     'wp-forge/container' =>
    50     array (
    51       'pretty_version' => '1.0',
    52       'version' => '1.0.0.0',
    53       'aliases' =>
    54       array (
    55       ),
    56       'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901',
    57     ),
    58     'wp-forge/wp-plugin-check' =>
    59     array (
    60       'pretty_version' => '1.0',
    61       'version' => '1.0.0.0',
    62       'aliases' =>
    63       array (
    64       ),
    65       'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',
    66     ),
    67     'wp-forge/wp-upgrade-handler' =>
    68     array (
    69       'pretty_version' => '1.0',
    70       'version' => '1.0.0.0',
    71       'aliases' =>
    72       array (
    73       ),
    74       'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',
    75     ),
    76     'wpscholar/mpress-hide-from-search' =>
    77     array (
    78       'pretty_version' => '1.1.3',
    79       'version' => '1.1.3.0',
    80       'aliases' =>
    81       array (
    82       ),
    83       'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    84     ),
    85   ),
    86 );
    87 private static $canGetVendors;
    88 private static $installedByVendor = array();
    89 
    90 
    91 
    92 
    93 
    94 
    95 
    96 public static function getInstalledPackages()
    97 {
    98 $packages = array();
    99 foreach (self::getInstalled() as $installed) {
    100 $packages[] = array_keys($installed['versions']);
     29    /**
     30     * @var mixed[]|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
     32     */
     33    private static $installed;
     34
     35    /**
     36     * @var bool|null
     37     */
     38    private static $canGetVendors;
     39
     40    /**
     41     * @var array[]
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     43     */
     44    private static $installedByVendor = array();
     45
     46    /**
     47     * Returns a list of all package names which are present, either by being installed, replaced or provided
     48     *
     49     * @return string[]
     50     * @psalm-return list<string>
     51     */
     52    public static function getInstalledPackages()
     53    {
     54        $packages = array();
     55        foreach (self::getInstalled() as $installed) {
     56            $packages[] = array_keys($installed['versions']);
     57        }
     58
     59        if (1 === \count($packages)) {
     60            return $packages[0];
     61        }
     62
     63        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
     64    }
     65
     66    /**
     67     * Returns a list of all package names with a specific type e.g. 'library'
     68     *
     69     * @param  string   $type
     70     * @return string[]
     71     * @psalm-return list<string>
     72     */
     73    public static function getInstalledPackagesByType($type)
     74    {
     75        $packagesByType = array();
     76
     77        foreach (self::getInstalled() as $installed) {
     78            foreach ($installed['versions'] as $name => $package) {
     79                if (isset($package['type']) && $package['type'] === $type) {
     80                    $packagesByType[] = $name;
     81                }
     82            }
     83        }
     84
     85        return $packagesByType;
     86    }
     87
     88    /**
     89     * Checks whether the given package is installed
     90     *
     91     * This also returns true if the package name is provided or replaced by another package
     92     *
     93     * @param  string $packageName
     94     * @param  bool   $includeDevRequirements
     95     * @return bool
     96     */
     97    public static function isInstalled($packageName, $includeDevRequirements = true)
     98    {
     99        foreach (self::getInstalled() as $installed) {
     100            if (isset($installed['versions'][$packageName])) {
     101                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
     102            }
     103        }
     104
     105        return false;
     106    }
     107
     108    /**
     109     * Checks whether the given package satisfies a version constraint
     110     *
     111     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
     112     *
     113     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
     114     *
     115     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
     116     * @param  string        $packageName
     117     * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
     118     * @return bool
     119     */
     120    public static function satisfies(VersionParser $parser, $packageName, $constraint)
     121    {
     122        $constraint = $parser->parseConstraints((string) $constraint);
     123        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
     124
     125        return $provided->matches($constraint);
     126    }
     127
     128    /**
     129     * Returns a version constraint representing all the range(s) which are installed for a given package
     130     *
     131     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
     132     * whether a given version of a package is installed, and not just whether it exists
     133     *
     134     * @param  string $packageName
     135     * @return string Version constraint usable with composer/semver
     136     */
     137    public static function getVersionRanges($packageName)
     138    {
     139        foreach (self::getInstalled() as $installed) {
     140            if (!isset($installed['versions'][$packageName])) {
     141                continue;
     142            }
     143
     144            $ranges = array();
     145            if (isset($installed['versions'][$packageName]['pretty_version'])) {
     146                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
     147            }
     148            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
     149                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
     150            }
     151            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
     152                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
     153            }
     154            if (array_key_exists('provided', $installed['versions'][$packageName])) {
     155                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
     156            }
     157
     158            return implode(' || ', $ranges);
     159        }
     160
     161        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     162    }
     163
     164    /**
     165     * @param  string      $packageName
     166     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
     167     */
     168    public static function getVersion($packageName)
     169    {
     170        foreach (self::getInstalled() as $installed) {
     171            if (!isset($installed['versions'][$packageName])) {
     172                continue;
     173            }
     174
     175            if (!isset($installed['versions'][$packageName]['version'])) {
     176                return null;
     177            }
     178
     179            return $installed['versions'][$packageName]['version'];
     180        }
     181
     182        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     183    }
     184
     185    /**
     186     * @param  string      $packageName
     187     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
     188     */
     189    public static function getPrettyVersion($packageName)
     190    {
     191        foreach (self::getInstalled() as $installed) {
     192            if (!isset($installed['versions'][$packageName])) {
     193                continue;
     194            }
     195
     196            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
     197                return null;
     198            }
     199
     200            return $installed['versions'][$packageName]['pretty_version'];
     201        }
     202
     203        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     204    }
     205
     206    /**
     207     * @param  string      $packageName
     208     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
     209     */
     210    public static function getReference($packageName)
     211    {
     212        foreach (self::getInstalled() as $installed) {
     213            if (!isset($installed['versions'][$packageName])) {
     214                continue;
     215            }
     216
     217            if (!isset($installed['versions'][$packageName]['reference'])) {
     218                return null;
     219            }
     220
     221            return $installed['versions'][$packageName]['reference'];
     222        }
     223
     224        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     225    }
     226
     227    /**
     228     * @param  string      $packageName
     229     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
     230     */
     231    public static function getInstallPath($packageName)
     232    {
     233        foreach (self::getInstalled() as $installed) {
     234            if (!isset($installed['versions'][$packageName])) {
     235                continue;
     236            }
     237
     238            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
     239        }
     240
     241        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     242    }
     243
     244    /**
     245     * @return array
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
     247     */
     248    public static function getRootPackage()
     249    {
     250        $installed = self::getInstalled();
     251
     252        return $installed[0]['root'];
     253    }
     254
     255    /**
     256     * Returns the raw installed.php data for custom implementations
     257     *
     258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
     259     * @return array[]
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
     261     */
     262    public static function getRawData()
     263    {
     264        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
     265
     266        if (null === self::$installed) {
     267            // only require the installed.php file if this file is loaded from its dumped location,
     268            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
     269            if (substr(__DIR__, -8, 1) !== 'C') {
     270                self::$installed = include __DIR__ . '/installed.php';
     271            } else {
     272                self::$installed = array();
     273            }
     274        }
     275
     276        return self::$installed;
     277    }
     278
     279    /**
     280     * Returns the raw data of all installed.php which are currently loaded for custom implementations
     281     *
     282     * @return array[]
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     284     */
     285    public static function getAllRawData()
     286    {
     287        return self::getInstalled();
     288    }
     289
     290    /**
     291     * Lets you reload the static array from another file
     292     *
     293     * This is only useful for complex integrations in which a project needs to use
     294     * this class but then also needs to execute another project's autoloader in process,
     295     * and wants to ensure both projects have access to their version of installed.php.
     296     *
     297     * A typical case would be PHPUnit, where it would need to make sure it reads all
     298     * the data it needs from this class, then call reload() with
     299     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
     300     * the project in which it runs can then also use this class safely, without
     301     * interference between PHPUnit's dependencies and the project's dependencies.
     302     *
     303     * @param  array[] $data A vendor/composer/installed.php data set
     304     * @return void
     305     *
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
     307     */
     308    public static function reload($data)
     309    {
     310        self::$installed = $data;
     311        self::$installedByVendor = array();
     312    }
     313
     314    /**
     315     * @return array[]
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     317     */
     318    private static function getInstalled()
     319    {
     320        if (null === self::$canGetVendors) {
     321            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
     322        }
     323
     324        $installed = array();
     325
     326        if (self::$canGetVendors) {
     327            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     328                if (isset(self::$installedByVendor[$vendorDir])) {
     329                    $installed[] = self::$installedByVendor[$vendorDir];
     330                } elseif (is_file($vendorDir.'/composer/installed.php')) {
     331                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     332                    $required = require $vendorDir.'/composer/installed.php';
     333                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
     334                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     335                        self::$installed = $installed[count($installed) - 1];
     336                    }
     337                }
     338            }
     339        }
     340
     341        if (null === self::$installed) {
     342            // only require the installed.php file if this file is loaded from its dumped location,
     343            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
     344            if (substr(__DIR__, -8, 1) !== 'C') {
     345                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     346                $required = require __DIR__ . '/installed.php';
     347                self::$installed = $required;
     348            } else {
     349                self::$installed = array();
     350            }
     351        }
     352
     353        if (self::$installed !== array()) {
     354            $installed[] = self::$installed;
     355        }
     356
     357        return $installed;
     358    }
    101359}
    102 
    103 if (1 === \count($packages)) {
    104 return $packages[0];
    105 }
    106 
    107 return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
    108 }
    109 
    110 
    111 
    112 
    113 
    114 
    115 
    116 
    117 
    118 public static function isInstalled($packageName)
    119 {
    120 foreach (self::getInstalled() as $installed) {
    121 if (isset($installed['versions'][$packageName])) {
    122 return true;
    123 }
    124 }
    125 
    126 return false;
    127 }
    128 
    129 
    130 
    131 
    132 
    133 
    134 
    135 
    136 
    137 
    138 
    139 
    140 
    141 
    142 public static function satisfies(VersionParser $parser, $packageName, $constraint)
    143 {
    144 $constraint = $parser->parseConstraints($constraint);
    145 $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    146 
    147 return $provided->matches($constraint);
    148 }
    149 
    150 
    151 
    152 
    153 
    154 
    155 
    156 
    157 
    158 
    159 public static function getVersionRanges($packageName)
    160 {
    161 foreach (self::getInstalled() as $installed) {
    162 if (!isset($installed['versions'][$packageName])) {
    163 continue;
    164 }
    165 
    166 $ranges = array();
    167 if (isset($installed['versions'][$packageName]['pretty_version'])) {
    168 $ranges[] = $installed['versions'][$packageName]['pretty_version'];
    169 }
    170 if (array_key_exists('aliases', $installed['versions'][$packageName])) {
    171 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
    172 }
    173 if (array_key_exists('replaced', $installed['versions'][$packageName])) {
    174 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
    175 }
    176 if (array_key_exists('provided', $installed['versions'][$packageName])) {
    177 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
    178 }
    179 
    180 return implode(' || ', $ranges);
    181 }
    182 
    183 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    184 }
    185 
    186 
    187 
    188 
    189 
    190 public static function getVersion($packageName)
    191 {
    192 foreach (self::getInstalled() as $installed) {
    193 if (!isset($installed['versions'][$packageName])) {
    194 continue;
    195 }
    196 
    197 if (!isset($installed['versions'][$packageName]['version'])) {
    198 return null;
    199 }
    200 
    201 return $installed['versions'][$packageName]['version'];
    202 }
    203 
    204 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    205 }
    206 
    207 
    208 
    209 
    210 
    211 public static function getPrettyVersion($packageName)
    212 {
    213 foreach (self::getInstalled() as $installed) {
    214 if (!isset($installed['versions'][$packageName])) {
    215 continue;
    216 }
    217 
    218 if (!isset($installed['versions'][$packageName]['pretty_version'])) {
    219 return null;
    220 }
    221 
    222 return $installed['versions'][$packageName]['pretty_version'];
    223 }
    224 
    225 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    226 }
    227 
    228 
    229 
    230 
    231 
    232 public static function getReference($packageName)
    233 {
    234 foreach (self::getInstalled() as $installed) {
    235 if (!isset($installed['versions'][$packageName])) {
    236 continue;
    237 }
    238 
    239 if (!isset($installed['versions'][$packageName]['reference'])) {
    240 return null;
    241 }
    242 
    243 return $installed['versions'][$packageName]['reference'];
    244 }
    245 
    246 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    247 }
    248 
    249 
    250 
    251 
    252 
    253 public static function getRootPackage()
    254 {
    255 $installed = self::getInstalled();
    256 
    257 return $installed[0]['root'];
    258 }
    259 
    260 
    261 
    262 
    263 
    264 
    265 
    266 public static function getRawData()
    267 {
    268 return self::$installed;
    269 }
    270 
    271 
    272 
    273 
    274 
    275 
    276 
    277 
    278 
    279 
    280 
    281 
    282 
    283 
    284 
    285 
    286 
    287 
    288 
    289 public static function reload($data)
    290 {
    291 self::$installed = $data;
    292 self::$installedByVendor = array();
    293 }
    294 
    295 
    296 
    297 
    298 
    299 private static function getInstalled()
    300 {
    301 if (null === self::$canGetVendors) {
    302 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
    303 }
    304 
    305 $installed = array();
    306 
    307 if (self::$canGetVendors) {
    308 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
    309 if (isset(self::$installedByVendor[$vendorDir])) {
    310 $installed[] = self::$installedByVendor[$vendorDir];
    311 } elseif (is_file($vendorDir.'/composer/installed.php')) {
    312 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
    313 }
    314 }
    315 }
    316 
    317 $installed[] = self::$installed;
    318 
    319 return $installed;
    320 }
    321 }
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_classmap.php

    r2507158 r2906632  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_namespaces.php

    r2328021 r2906632  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_psr4.php

    r2328021 r2906632  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_real.php

    r2531747 r2906632  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc
     5class ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/autoload_static.php

    r2531747 r2906632  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc
     7class ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5959    {
    6060        return \Closure::bind(function () use ($loader) {
    61             $loader->prefixLengthsPsr4 = ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::$prefixLengthsPsr4;
    62             $loader->prefixDirsPsr4 = ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::$prefixDirsPsr4;
    63             $loader->classMap = ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::$classMap;
     61            $loader->prefixLengthsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixLengthsPsr4;
     62            $loader->prefixDirsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixDirsPsr4;
     63            $loader->classMap = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$classMap;
    6464
    6565        }, null, ClassLoader::class);
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/installed.php

    r2531747 r2906632  
    1 <?php return array (
    2   'root' =>
    3   array (
    4     'pretty_version' => '1.1.3',
    5     'version' => '1.1.3.0',
    6     'aliases' =>
    7     array (
     1<?php return array(
     2    'root' => array(
     3        'name' => 'wpscholar/mpress-hide-from-search',
     4        'pretty_version' => '1.1.4',
     5        'version' => '1.1.4.0',
     6        'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730',
     7        'type' => 'wordpress-plugin',
     8        'install_path' => __DIR__ . '/../../',
     9        'aliases' => array(),
     10        'dev' => false,
    811    ),
    9     'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    10     'name' => 'wpscholar/mpress-hide-from-search',
    11   ),
    12   'versions' =>
    13   array (
    14     'psr/container' =>
    15     array (
    16       'pretty_version' => '1.1.1',
    17       'version' => '1.1.1.0',
    18       'aliases' =>
    19       array (
    20       ),
    21       'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
     12    'versions' => array(
     13        'psr/container' => array(
     14            'pretty_version' => '1.1.2',
     15            'version' => '1.1.2.0',
     16            'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
     17            'type' => 'library',
     18            'install_path' => __DIR__ . '/../psr/container',
     19            'aliases' => array(),
     20            'dev_requirement' => false,
     21        ),
     22        'wp-forge/container' => array(
     23            'pretty_version' => '1.1',
     24            'version' => '1.1.0.0',
     25            'reference' => '1c48853f79b6319e4e7f14b9f3e28c2142ec89b5',
     26            'type' => 'library',
     27            'install_path' => __DIR__ . '/../wp-forge/container',
     28            'aliases' => array(),
     29            'dev_requirement' => false,
     30        ),
     31        'wp-forge/wp-plugin-check' => array(
     32            'pretty_version' => '1.0',
     33            'version' => '1.0.0.0',
     34            'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',
     35            'type' => 'library',
     36            'install_path' => __DIR__ . '/../wp-forge/wp-plugin-check',
     37            'aliases' => array(),
     38            'dev_requirement' => false,
     39        ),
     40        'wp-forge/wp-upgrade-handler' => array(
     41            'pretty_version' => '1.0',
     42            'version' => '1.0.0.0',
     43            'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',
     44            'type' => 'library',
     45            'install_path' => __DIR__ . '/../wp-forge/wp-upgrade-handler',
     46            'aliases' => array(),
     47            'dev_requirement' => false,
     48        ),
     49        'wpscholar/mpress-hide-from-search' => array(
     50            'pretty_version' => '1.1.4',
     51            'version' => '1.1.4.0',
     52            'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730',
     53            'type' => 'wordpress-plugin',
     54            'install_path' => __DIR__ . '/../../',
     55            'aliases' => array(),
     56            'dev_requirement' => false,
     57        ),
    2258    ),
    23     'wp-forge/container' =>
    24     array (
    25       'pretty_version' => '1.0',
    26       'version' => '1.0.0.0',
    27       'aliases' =>
    28       array (
    29       ),
    30       'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901',
    31     ),
    32     'wp-forge/wp-plugin-check' =>
    33     array (
    34       'pretty_version' => '1.0',
    35       'version' => '1.0.0.0',
    36       'aliases' =>
    37       array (
    38       ),
    39       'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',
    40     ),
    41     'wp-forge/wp-upgrade-handler' =>
    42     array (
    43       'pretty_version' => '1.0',
    44       'version' => '1.0.0.0',
    45       'aliases' =>
    46       array (
    47       ),
    48       'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',
    49     ),
    50     'wpscholar/mpress-hide-from-search' =>
    51     array (
    52       'pretty_version' => '1.1.3',
    53       'version' => '1.1.3.0',
    54       'aliases' =>
    55       array (
    56       ),
    57       'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    58     ),
    59   ),
    6059);
  • mpress-hide-from-search/tags/1.1.4/vendor/composer/platform_check.php

    r2507158 r2906632  
    55$issues = array();
    66
    7 if (!(PHP_VERSION_ID >= 70200)) {
    8     $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.';
     7if (!(PHP_VERSION_ID >= 70400)) {
     8    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
    99}
    1010
  • mpress-hide-from-search/tags/1.1.4/vendor/psr/container/src/ContainerExceptionInterface.php

    r2507158 r2906632  
    33namespace Psr\Container;
    44
     5use Throwable;
     6
    57/**
    68 * Base interface representing a generic exception in a container.
    79 */
    8 interface ContainerExceptionInterface
     10interface ContainerExceptionInterface extends Throwable
    911{
    1012}
  • mpress-hide-from-search/tags/1.1.4/vendor/wp-forge/container/includes/Container.php

    r2328021 r2906632  
    9595     * @return bool
    9696     */
    97     public function has( $id ) {
     97    public function has( string $id ) {
    9898        return array_key_exists( $id, $this->entries );
    9999    }
     
    108108     * @throws NotFoundException
    109109     */
    110     public function raw( $id ) {
     110    public function raw( string $id ) {
    111111        if ( ! $this->has( $id ) ) {
    112112            throw new NotFoundException( sprintf( 'No entry was found for "%s" identifier.', $id ) );
     
    125125     * @throws NotFoundException  No entry was found for **this** identifier.
    126126     */
    127     public function get( $id ) {
     127    public function get( string $id ) {
    128128        // Return class instance, if available.
    129129        if ( isset( $this->instances[ $id ] ) ) {
     
    162162     * @return $this
    163163     */
    164     public function set( $id, $value ) {
     164    public function set( string $id, $value ) {
    165165        $this->entries[ $id ] = $value;
    166166
     
    177177     * @throws NotFoundException
    178178     */
    179     public function delete( $id ) {
     179    public function delete( string $id ) {
    180180        if ( $this->has( $id ) ) {
    181181            $value = $this->get( $id );
     
    200200     * @return $this
    201201     */
    202     public function deleteInstance( $id ) {
     202    public function deleteInstance( string $id ) {
    203203        unset( $this->instances[ $id ] );
    204204
     
    228228     * @throws NotFoundException
    229229     */
    230     public function extend( $id, Closure $closure ) {
     230    public function extend( string $id, Closure $closure ) {
    231231
    232232        // Get the existing raw value
  • mpress-hide-from-search/trunk/includes/MetaBox.php

    r2328021 r2906632  
    2626            add_meta_box(
    2727                'hide-from-search',
    28                 esc_html__( 'Hide from Search', 'hide-from-search' ),
     28                esc_html__( 'Hide from Search', 'mpress-hide-from-search' ),
    2929                array( __CLASS__, 'render' ),
    3030                $post_type,
  • mpress-hide-from-search/trunk/includes/Plugin.php

    r2531747 r2906632  
    117117            array(
    118118                'type'              => 'boolean',
    119                 'description'       => esc_html__( 'Hide from WordPress search', 'hide-from-search' ),
     119                'description'       => esc_html__( 'Hide from WordPress search', 'mpress-hide-from-search' ),
    120120                'single'            => true,
    121121                'sanitize_callback' => function ( $value ) {
     
    137137            array(
    138138                'type'              => 'boolean',
    139                 'description'       => esc_html__( 'Hide from search engines', 'hide-from-search' ),
     139                'description'       => esc_html__( 'Hide from search engines', 'mpress-hide-from-search' ),
    140140                'single'            => true,
    141141                'sanitize_callback' => function ( $value ) {
  • mpress-hide-from-search/trunk/languages/mpress-hide-from-search.pot

    r2286622 r2906632  
    1 # Copyright (C) 2020 Micah Wood
    2 # This file is distributed under the GPL3.
     1# Copyright (C) 2023 Micah Wood
     2# This file is distributed under the GPL V2 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Hide from Search 1.0.2\n"
    6 "Report-Msgid-Bugs-To: "
    7 "https://wordpress.org/support/plugin/mpress-hide-from-search\n"
    8 "POT-Creation-Date: 2020-04-19 03:39:51+00:00\n"
    9 "MIME-Version: 1.0\n"
    10 "Content-Type: text/plain; charset=utf-8\n"
    11 "Content-Transfer-Encoding: 8bit\n"
    12 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
     5"Project-Id-Version: Hide from Search 1.1.4\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mpress-hide-from-search\n"
    137"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    148"Language-Team: LANGUAGE <[email protected]>\n"
    15 "X-Generator: node-wp-i18n 1.2.3\n"
     9"MIME-Version: 1.0\n"
     10"Content-Type: text/plain; charset=UTF-8\n"
     11"Content-Transfer-Encoding: 8bit\n"
     12"POT-Creation-Date: \n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.7.1\n"
     15"X-Domain: mpress-hide-from-search\n"
    1616
    17 #. Plugin Name of the plugin/theme
     17#. Plugin Name of the plugin
     18#: includes/MetaBox.php:28
    1819msgid "Hide from Search"
    1920msgstr ""
    2021
    21 #: mpress-hide-from-search.php:104
    22 #. translators: post type
    23 msgid "Hide this %s from WordPress search"
     22#. Plugin URI of the plugin
     23msgid "https://wordpress.org/plugins/mpress-hide-from-search/"
    2424msgstr ""
    2525
    26 #. Plugin URI of the plugin/theme
    27 msgid "https://wpscholar.com/wordpress-plugins/mpress-hide-from-search/"
     26#. Description of the plugin
     27msgid "Hide individual WordPress pages from search engines and/or WordPress search results."
    2828msgstr ""
    2929
    30 #. Description of the plugin/theme
    31 msgid ""
    32 "Hide individual posts, pages and other post types from the default "
    33 "WordPress search functionality."
    34 msgstr ""
    35 
    36 #. Author of the plugin/theme
     30#. Author of the plugin
    3731msgid "Micah Wood"
    3832msgstr ""
    3933
    40 #. Author URI of the plugin/theme
    41 msgid "https://wpscholar.com/"
     34#. Author URI of the plugin
     35msgid "https://wpscholar.com"
    4236msgstr ""
     37
     38#: includes/Plugin.php:119
     39msgid "Hide from WordPress search"
     40msgstr ""
     41
     42#: includes/Plugin.php:139
     43msgid "Hide from search engines"
     44msgstr ""
  • mpress-hide-from-search/trunk/mpress-hide-from-search.php

    r2531747 r2906632  
    55 * @package           HideFromSearch
    66 * @author            Micah Wood
    7  * @copyright         Copyright 2020 by Micah Wood - All rights reserved.
     7 * @copyright         Copyright 2020-2023 by Micah Wood - All rights reserved.
    88 * @license           GPL2.0-or-later
    99 *
     
    1212 * Plugin URI:        https://wordpress.org/plugins/mpress-hide-from-search/
    1313 * Description:       Hide individual WordPress pages from search engines and/or WordPress search results.
    14  * Version:           1.1.3
    15  * Requires PHP:      5.6
    16  * Requires at least: 5.0
     14 * Version:           1.1.4
     15 * Requires PHP:      7.4
     16 * Requires at least: 6.0
    1717 * Author:            Micah Wood
    1818 * Author URI:        https://wpscholar.com
     
    2323 */
    2424
    25 define( 'HIDE_FROM_SEARCH_VERSION', '1.1.3' );
     25define( 'HIDE_FROM_SEARCH_VERSION', '1.1.4' );
    2626define( 'HIDE_FROM_SEARCH_FILE', __FILE__ );
    2727
    28 require dirname( __FILE__ ) . '/vendor/autoload.php';
     28require __DIR__ . '/vendor/autoload.php';
    2929
    3030// Check plugin requirements
     
    3333    $plugin_check = new WP_Forge_Plugin_Check( __FILE__ );
    3434
    35     $plugin_check->min_php_version = '5.6';
    36     $plugin_check->min_wp_version  = '5.0';
     35    $plugin_check->min_php_version = '7.4';
     36    $plugin_check->min_wp_version  = '6.0';
    3737    $plugin_check->check_plugin_requirements();
    3838}
    3939
    40 require dirname( __FILE__ ) . '/includes/Plugin.php';
     40require __DIR__ . '/includes/Plugin.php';
  • mpress-hide-from-search/trunk/readme.txt

    r2531747 r2906632  
    33Donate link: https://www.paypal.me/wpscholar
    44Tags: search, search engines, WordPress search, hide from search, exclude from search, hide post, hidden posts
    5 Requires at least: 5.0
    6 Requires PHP: 5.6
    7 Tested up to: 5.7
    8 Stable tag: 1.1.3
     5Requires at least: 6.0
     6Requires PHP: 7.4
     7Tested up to: 6.2
     8Stable tag: 1.1.4
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    6767== Changelog ==
    6868
     69= 1.1.4 =
     70* Minor maintenance release
     71
    6972= 1.1.3 =
    7073* Fix PHP notice when Yoast SEO is active
     
    121124== Upgrade Notice ==
    122125
     126= 1.1.4 =
     127* Minor maintenance release
     128
    123129= 1.1.3 =
    124130* Bugfix and security release.
  • mpress-hide-from-search/trunk/vendor/autoload.php

    r2531747 r2906632  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
    7 return ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc::getLoader();
     25return ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59::getLoader();
  • mpress-hide-from-search/trunk/vendor/composer/ClassLoader.php

    r2507158 r2906632  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
     48    /** @var ?string */
    4549    private $vendorDir;
    4650
    4751    // PSR-4
     52    /**
     53     * @var array[]
     54     * @psalm-var array<string, array<string, int>>
     55     */
    4856    private $prefixLengthsPsr4 = array();
     57    /**
     58     * @var array[]
     59     * @psalm-var array<string, array<int, string>>
     60     */
    4961    private $prefixDirsPsr4 = array();
     62    /**
     63     * @var array[]
     64     * @psalm-var array<string, string>
     65     */
    5066    private $fallbackDirsPsr4 = array();
    5167
    5268    // PSR-0
     69    /**
     70     * @var array[]
     71     * @psalm-var array<string, array<string, string[]>>
     72     */
    5373    private $prefixesPsr0 = array();
     74    /**
     75     * @var array[]
     76     * @psalm-var array<string, string>
     77     */
    5478    private $fallbackDirsPsr0 = array();
    5579
     80    /** @var bool */
    5681    private $useIncludePath = false;
     82
     83    /**
     84     * @var string[]
     85     * @psalm-var array<string, string>
     86     */
    5787    private $classMap = array();
     88
     89    /** @var bool */
    5890    private $classMapAuthoritative = false;
     91
     92    /**
     93     * @var bool[]
     94     * @psalm-var array<string, bool>
     95     */
    5996    private $missingClasses = array();
     97
     98    /** @var ?string */
    6099    private $apcuPrefix;
    61100
     101    /**
     102     * @var self[]
     103     */
    62104    private static $registeredLoaders = array();
    63105
     106    /**
     107     * @param ?string $vendorDir
     108     */
    64109    public function __construct($vendorDir = null)
    65110    {
    66111        $this->vendorDir = $vendorDir;
    67     }
    68 
     112        self::initializeIncludeClosure();
     113    }
     114
     115    /**
     116     * @return string[]
     117     */
    69118    public function getPrefixes()
    70119    {
     
    76125    }
    77126
     127    /**
     128     * @return array[]
     129     * @psalm-return array<string, array<int, string>>
     130     */
    78131    public function getPrefixesPsr4()
    79132    {
     
    81134    }
    82135
     136    /**
     137     * @return array[]
     138     * @psalm-return array<string, string>
     139     */
    83140    public function getFallbackDirs()
    84141    {
     
    86143    }
    87144
     145    /**
     146     * @return array[]
     147     * @psalm-return array<string, string>
     148     */
    88149    public function getFallbackDirsPsr4()
    89150    {
     
    91152    }
    92153
     154    /**
     155     * @return string[] Array of classname => path
     156     * @psalm-return array<string, string>
     157     */
    93158    public function getClassMap()
    94159    {
     
    97162
    98163    /**
    99      * @param array $classMap Class to filename map
     164     * @param string[] $classMap Class to filename map
     165     * @psalm-param array<string, string> $classMap
     166     *
     167     * @return void
    100168     */
    101169    public function addClassMap(array $classMap)
     
    112180     * appending or prepending to the ones previously set for this prefix.
    113181     *
    114      * @param string       $prefix  The prefix
    115      * @param array|string $paths   The PSR-0 root directories
    116      * @param bool         $prepend Whether to prepend the directories
     182     * @param string          $prefix  The prefix
     183     * @param string[]|string $paths   The PSR-0 root directories
     184     * @param bool            $prepend Whether to prepend the directories
     185     *
     186     * @return void
    117187     */
    118188    public function add($prefix, $paths, $prepend = false)
     
    157227     * appending or prepending to the ones previously set for this namespace.
    158228     *
    159      * @param string       $prefix  The prefix/namespace, with trailing '\\'
    160      * @param array|string $paths   The PSR-4 base directories
    161      * @param bool         $prepend Whether to prepend the directories
     229     * @param string          $prefix  The prefix/namespace, with trailing '\\'
     230     * @param string[]|string $paths   The PSR-4 base directories
     231     * @param bool            $prepend Whether to prepend the directories
    162232     *
    163233     * @throws \InvalidArgumentException
     234     *
     235     * @return void
    164236     */
    165237    public function addPsr4($prefix, $paths, $prepend = false)
     
    205277     * replacing any others previously set for this prefix.
    206278     *
    207      * @param string       $prefix The prefix
    208      * @param array|string $paths  The PSR-0 base directories
     279     * @param string          $prefix The prefix
     280     * @param string[]|string $paths  The PSR-0 base directories
     281     *
     282     * @return void
    209283     */
    210284    public function set($prefix, $paths)
     
    221295     * replacing any others previously set for this namespace.
    222296     *
    223      * @param string       $prefix The prefix/namespace, with trailing '\\'
    224      * @param array|string $paths  The PSR-4 base directories
     297     * @param string          $prefix The prefix/namespace, with trailing '\\'
     298     * @param string[]|string $paths  The PSR-4 base directories
    225299     *
    226300     * @throws \InvalidArgumentException
     301     *
     302     * @return void
    227303     */
    228304    public function setPsr4($prefix, $paths)
     
    244320     *
    245321     * @param bool $useIncludePath
     322     *
     323     * @return void
    246324     */
    247325    public function setUseIncludePath($useIncludePath)
     
    266344     *
    267345     * @param bool $classMapAuthoritative
     346     *
     347     * @return void
    268348     */
    269349    public function setClassMapAuthoritative($classMapAuthoritative)
     
    286366     *
    287367     * @param string|null $apcuPrefix
     368     *
     369     * @return void
    288370     */
    289371    public function setApcuPrefix($apcuPrefix)
     
    306388     *
    307389     * @param bool $prepend Whether to prepend the autoloader or not
     390     *
     391     * @return void
    308392     */
    309393    public function register($prepend = false)
     
    325409    /**
    326410     * Unregisters this instance as an autoloader.
     411     *
     412     * @return void
    327413     */
    328414    public function unregister()
     
    339425     *
    340426     * @param  string    $class The name of the class
    341      * @return bool|null True if loaded, null otherwise
     427     * @return true|null True if loaded, null otherwise
    342428     */
    343429    public function loadClass($class)
    344430    {
    345431        if ($file = $this->findFile($class)) {
    346             includeFile($file);
     432            $includeFile = self::$includeFile;
     433            $includeFile($file);
    347434
    348435            return true;
    349436        }
     437
     438        return null;
    350439    }
    351440
     
    402491    }
    403492
     493    /**
     494     * @param  string       $class
     495     * @param  string       $ext
     496     * @return string|false
     497     */
    404498    private function findFileWithExtension($class, $ext)
    405499    {
     
    467561        return false;
    468562    }
     563
     564    /**
     565     * @return void
     566     */
     567    private static function initializeIncludeClosure()
     568    {
     569        if (self::$includeFile !== null) {
     570            return;
     571        }
     572
     573        /**
     574         * Scope isolated include.
     575         *
     576         * Prevents access to $this/self from included files.
     577         *
     578         * @param  string $file
     579         * @return void
     580         */
     581        self::$includeFile = \Closure::bind(static function($file) {
     582            include $file;
     583        }, null, null);
     584    }
    469585}
    470 
    471 /**
    472  * Scope isolated include.
    473  *
    474  * Prevents access to $this/self from included files.
    475  */
    476 function includeFile($file)
    477 {
    478     include $file;
    479 }
  • mpress-hide-from-search/trunk/vendor/composer/InstalledVersions.php

    r2531747 r2906632  
    11<?php
    22
    3 
    4 
    5 
    6 
    7 
    8 
    9 
    10 
    11 
     3/*
     4 * This file is part of Composer.
     5 *
     6 * (c) Nils Adermann <[email protected]>
     7 *     Jordi Boggiano <[email protected]>
     8 *
     9 * For the full copyright and license information, please view the LICENSE
     10 * file that was distributed with this source code.
     11 */
    1212
    1313namespace Composer;
     
    1616use Composer\Semver\VersionParser;
    1717
    18 
    19 
    20 
    21 
    22 
    23 
    24 
     18/**
     19 * This class is copied in every Composer installed project and available to all
     20 *
     21 * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
     22 *
     23 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
     26 */
    2527class InstalledVersions
    2628{
    27 private static $installed = array (
    28   'root' =>
    29   array (
    30     'pretty_version' => '1.1.3',
    31     'version' => '1.1.3.0',
    32     'aliases' =>
    33     array (
    34     ),
    35     'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    36     'name' => 'wpscholar/mpress-hide-from-search',
    37   ),
    38   'versions' =>
    39   array (
    40     'psr/container' =>
    41     array (
    42       'pretty_version' => '1.1.1',
    43       'version' => '1.1.1.0',
    44       'aliases' =>
    45       array (
    46       ),
    47       'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
    48     ),
    49     'wp-forge/container' =>
    50     array (
    51       'pretty_version' => '1.0',
    52       'version' => '1.0.0.0',
    53       'aliases' =>
    54       array (
    55       ),
    56       'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901',
    57     ),
    58     'wp-forge/wp-plugin-check' =>
    59     array (
    60       'pretty_version' => '1.0',
    61       'version' => '1.0.0.0',
    62       'aliases' =>
    63       array (
    64       ),
    65       'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',
    66     ),
    67     'wp-forge/wp-upgrade-handler' =>
    68     array (
    69       'pretty_version' => '1.0',
    70       'version' => '1.0.0.0',
    71       'aliases' =>
    72       array (
    73       ),
    74       'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',
    75     ),
    76     'wpscholar/mpress-hide-from-search' =>
    77     array (
    78       'pretty_version' => '1.1.3',
    79       'version' => '1.1.3.0',
    80       'aliases' =>
    81       array (
    82       ),
    83       'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    84     ),
    85   ),
    86 );
    87 private static $canGetVendors;
    88 private static $installedByVendor = array();
    89 
    90 
    91 
    92 
    93 
    94 
    95 
    96 public static function getInstalledPackages()
    97 {
    98 $packages = array();
    99 foreach (self::getInstalled() as $installed) {
    100 $packages[] = array_keys($installed['versions']);
     29    /**
     30     * @var mixed[]|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
     32     */
     33    private static $installed;
     34
     35    /**
     36     * @var bool|null
     37     */
     38    private static $canGetVendors;
     39
     40    /**
     41     * @var array[]
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     43     */
     44    private static $installedByVendor = array();
     45
     46    /**
     47     * Returns a list of all package names which are present, either by being installed, replaced or provided
     48     *
     49     * @return string[]
     50     * @psalm-return list<string>
     51     */
     52    public static function getInstalledPackages()
     53    {
     54        $packages = array();
     55        foreach (self::getInstalled() as $installed) {
     56            $packages[] = array_keys($installed['versions']);
     57        }
     58
     59        if (1 === \count($packages)) {
     60            return $packages[0];
     61        }
     62
     63        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
     64    }
     65
     66    /**
     67     * Returns a list of all package names with a specific type e.g. 'library'
     68     *
     69     * @param  string   $type
     70     * @return string[]
     71     * @psalm-return list<string>
     72     */
     73    public static function getInstalledPackagesByType($type)
     74    {
     75        $packagesByType = array();
     76
     77        foreach (self::getInstalled() as $installed) {
     78            foreach ($installed['versions'] as $name => $package) {
     79                if (isset($package['type']) && $package['type'] === $type) {
     80                    $packagesByType[] = $name;
     81                }
     82            }
     83        }
     84
     85        return $packagesByType;
     86    }
     87
     88    /**
     89     * Checks whether the given package is installed
     90     *
     91     * This also returns true if the package name is provided or replaced by another package
     92     *
     93     * @param  string $packageName
     94     * @param  bool   $includeDevRequirements
     95     * @return bool
     96     */
     97    public static function isInstalled($packageName, $includeDevRequirements = true)
     98    {
     99        foreach (self::getInstalled() as $installed) {
     100            if (isset($installed['versions'][$packageName])) {
     101                return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
     102            }
     103        }
     104
     105        return false;
     106    }
     107
     108    /**
     109     * Checks whether the given package satisfies a version constraint
     110     *
     111     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
     112     *
     113     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
     114     *
     115     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
     116     * @param  string        $packageName
     117     * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
     118     * @return bool
     119     */
     120    public static function satisfies(VersionParser $parser, $packageName, $constraint)
     121    {
     122        $constraint = $parser->parseConstraints((string) $constraint);
     123        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
     124
     125        return $provided->matches($constraint);
     126    }
     127
     128    /**
     129     * Returns a version constraint representing all the range(s) which are installed for a given package
     130     *
     131     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
     132     * whether a given version of a package is installed, and not just whether it exists
     133     *
     134     * @param  string $packageName
     135     * @return string Version constraint usable with composer/semver
     136     */
     137    public static function getVersionRanges($packageName)
     138    {
     139        foreach (self::getInstalled() as $installed) {
     140            if (!isset($installed['versions'][$packageName])) {
     141                continue;
     142            }
     143
     144            $ranges = array();
     145            if (isset($installed['versions'][$packageName]['pretty_version'])) {
     146                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
     147            }
     148            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
     149                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
     150            }
     151            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
     152                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
     153            }
     154            if (array_key_exists('provided', $installed['versions'][$packageName])) {
     155                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
     156            }
     157
     158            return implode(' || ', $ranges);
     159        }
     160
     161        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     162    }
     163
     164    /**
     165     * @param  string      $packageName
     166     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
     167     */
     168    public static function getVersion($packageName)
     169    {
     170        foreach (self::getInstalled() as $installed) {
     171            if (!isset($installed['versions'][$packageName])) {
     172                continue;
     173            }
     174
     175            if (!isset($installed['versions'][$packageName]['version'])) {
     176                return null;
     177            }
     178
     179            return $installed['versions'][$packageName]['version'];
     180        }
     181
     182        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     183    }
     184
     185    /**
     186     * @param  string      $packageName
     187     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
     188     */
     189    public static function getPrettyVersion($packageName)
     190    {
     191        foreach (self::getInstalled() as $installed) {
     192            if (!isset($installed['versions'][$packageName])) {
     193                continue;
     194            }
     195
     196            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
     197                return null;
     198            }
     199
     200            return $installed['versions'][$packageName]['pretty_version'];
     201        }
     202
     203        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     204    }
     205
     206    /**
     207     * @param  string      $packageName
     208     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
     209     */
     210    public static function getReference($packageName)
     211    {
     212        foreach (self::getInstalled() as $installed) {
     213            if (!isset($installed['versions'][$packageName])) {
     214                continue;
     215            }
     216
     217            if (!isset($installed['versions'][$packageName]['reference'])) {
     218                return null;
     219            }
     220
     221            return $installed['versions'][$packageName]['reference'];
     222        }
     223
     224        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     225    }
     226
     227    /**
     228     * @param  string      $packageName
     229     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
     230     */
     231    public static function getInstallPath($packageName)
     232    {
     233        foreach (self::getInstalled() as $installed) {
     234            if (!isset($installed['versions'][$packageName])) {
     235                continue;
     236            }
     237
     238            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
     239        }
     240
     241        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
     242    }
     243
     244    /**
     245     * @return array
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
     247     */
     248    public static function getRootPackage()
     249    {
     250        $installed = self::getInstalled();
     251
     252        return $installed[0]['root'];
     253    }
     254
     255    /**
     256     * Returns the raw installed.php data for custom implementations
     257     *
     258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
     259     * @return array[]
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
     261     */
     262    public static function getRawData()
     263    {
     264        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
     265
     266        if (null === self::$installed) {
     267            // only require the installed.php file if this file is loaded from its dumped location,
     268            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
     269            if (substr(__DIR__, -8, 1) !== 'C') {
     270                self::$installed = include __DIR__ . '/installed.php';
     271            } else {
     272                self::$installed = array();
     273            }
     274        }
     275
     276        return self::$installed;
     277    }
     278
     279    /**
     280     * Returns the raw data of all installed.php which are currently loaded for custom implementations
     281     *
     282     * @return array[]
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     284     */
     285    public static function getAllRawData()
     286    {
     287        return self::getInstalled();
     288    }
     289
     290    /**
     291     * Lets you reload the static array from another file
     292     *
     293     * This is only useful for complex integrations in which a project needs to use
     294     * this class but then also needs to execute another project's autoloader in process,
     295     * and wants to ensure both projects have access to their version of installed.php.
     296     *
     297     * A typical case would be PHPUnit, where it would need to make sure it reads all
     298     * the data it needs from this class, then call reload() with
     299     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
     300     * the project in which it runs can then also use this class safely, without
     301     * interference between PHPUnit's dependencies and the project's dependencies.
     302     *
     303     * @param  array[] $data A vendor/composer/installed.php data set
     304     * @return void
     305     *
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
     307     */
     308    public static function reload($data)
     309    {
     310        self::$installed = $data;
     311        self::$installedByVendor = array();
     312    }
     313
     314    /**
     315     * @return array[]
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
     317     */
     318    private static function getInstalled()
     319    {
     320        if (null === self::$canGetVendors) {
     321            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
     322        }
     323
     324        $installed = array();
     325
     326        if (self::$canGetVendors) {
     327            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     328                if (isset(self::$installedByVendor[$vendorDir])) {
     329                    $installed[] = self::$installedByVendor[$vendorDir];
     330                } elseif (is_file($vendorDir.'/composer/installed.php')) {
     331                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     332                    $required = require $vendorDir.'/composer/installed.php';
     333                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
     334                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     335                        self::$installed = $installed[count($installed) - 1];
     336                    }
     337                }
     338            }
     339        }
     340
     341        if (null === self::$installed) {
     342            // only require the installed.php file if this file is loaded from its dumped location,
     343            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
     344            if (substr(__DIR__, -8, 1) !== 'C') {
     345                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
     346                $required = require __DIR__ . '/installed.php';
     347                self::$installed = $required;
     348            } else {
     349                self::$installed = array();
     350            }
     351        }
     352
     353        if (self::$installed !== array()) {
     354            $installed[] = self::$installed;
     355        }
     356
     357        return $installed;
     358    }
    101359}
    102 
    103 if (1 === \count($packages)) {
    104 return $packages[0];
    105 }
    106 
    107 return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
    108 }
    109 
    110 
    111 
    112 
    113 
    114 
    115 
    116 
    117 
    118 public static function isInstalled($packageName)
    119 {
    120 foreach (self::getInstalled() as $installed) {
    121 if (isset($installed['versions'][$packageName])) {
    122 return true;
    123 }
    124 }
    125 
    126 return false;
    127 }
    128 
    129 
    130 
    131 
    132 
    133 
    134 
    135 
    136 
    137 
    138 
    139 
    140 
    141 
    142 public static function satisfies(VersionParser $parser, $packageName, $constraint)
    143 {
    144 $constraint = $parser->parseConstraints($constraint);
    145 $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
    146 
    147 return $provided->matches($constraint);
    148 }
    149 
    150 
    151 
    152 
    153 
    154 
    155 
    156 
    157 
    158 
    159 public static function getVersionRanges($packageName)
    160 {
    161 foreach (self::getInstalled() as $installed) {
    162 if (!isset($installed['versions'][$packageName])) {
    163 continue;
    164 }
    165 
    166 $ranges = array();
    167 if (isset($installed['versions'][$packageName]['pretty_version'])) {
    168 $ranges[] = $installed['versions'][$packageName]['pretty_version'];
    169 }
    170 if (array_key_exists('aliases', $installed['versions'][$packageName])) {
    171 $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
    172 }
    173 if (array_key_exists('replaced', $installed['versions'][$packageName])) {
    174 $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
    175 }
    176 if (array_key_exists('provided', $installed['versions'][$packageName])) {
    177 $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
    178 }
    179 
    180 return implode(' || ', $ranges);
    181 }
    182 
    183 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    184 }
    185 
    186 
    187 
    188 
    189 
    190 public static function getVersion($packageName)
    191 {
    192 foreach (self::getInstalled() as $installed) {
    193 if (!isset($installed['versions'][$packageName])) {
    194 continue;
    195 }
    196 
    197 if (!isset($installed['versions'][$packageName]['version'])) {
    198 return null;
    199 }
    200 
    201 return $installed['versions'][$packageName]['version'];
    202 }
    203 
    204 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    205 }
    206 
    207 
    208 
    209 
    210 
    211 public static function getPrettyVersion($packageName)
    212 {
    213 foreach (self::getInstalled() as $installed) {
    214 if (!isset($installed['versions'][$packageName])) {
    215 continue;
    216 }
    217 
    218 if (!isset($installed['versions'][$packageName]['pretty_version'])) {
    219 return null;
    220 }
    221 
    222 return $installed['versions'][$packageName]['pretty_version'];
    223 }
    224 
    225 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    226 }
    227 
    228 
    229 
    230 
    231 
    232 public static function getReference($packageName)
    233 {
    234 foreach (self::getInstalled() as $installed) {
    235 if (!isset($installed['versions'][$packageName])) {
    236 continue;
    237 }
    238 
    239 if (!isset($installed['versions'][$packageName]['reference'])) {
    240 return null;
    241 }
    242 
    243 return $installed['versions'][$packageName]['reference'];
    244 }
    245 
    246 throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
    247 }
    248 
    249 
    250 
    251 
    252 
    253 public static function getRootPackage()
    254 {
    255 $installed = self::getInstalled();
    256 
    257 return $installed[0]['root'];
    258 }
    259 
    260 
    261 
    262 
    263 
    264 
    265 
    266 public static function getRawData()
    267 {
    268 return self::$installed;
    269 }
    270 
    271 
    272 
    273 
    274 
    275 
    276 
    277 
    278 
    279 
    280 
    281 
    282 
    283 
    284 
    285 
    286 
    287 
    288 
    289 public static function reload($data)
    290 {
    291 self::$installed = $data;
    292 self::$installedByVendor = array();
    293 }
    294 
    295 
    296 
    297 
    298 
    299 private static function getInstalled()
    300 {
    301 if (null === self::$canGetVendors) {
    302 self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
    303 }
    304 
    305 $installed = array();
    306 
    307 if (self::$canGetVendors) {
    308 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
    309 if (isset(self::$installedByVendor[$vendorDir])) {
    310 $installed[] = self::$installedByVendor[$vendorDir];
    311 } elseif (is_file($vendorDir.'/composer/installed.php')) {
    312 $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
    313 }
    314 }
    315 }
    316 
    317 $installed[] = self::$installed;
    318 
    319 return $installed;
    320 }
    321 }
  • mpress-hide-from-search/trunk/vendor/composer/autoload_classmap.php

    r2507158 r2906632  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • mpress-hide-from-search/trunk/vendor/composer/autoload_namespaces.php

    r2328021 r2906632  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • mpress-hide-from-search/trunk/vendor/composer/autoload_psr4.php

    r2328021 r2906632  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • mpress-hide-from-search/trunk/vendor/composer/autoload_real.php

    r2531747 r2906632  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc
     5class ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'), true, true);
    28         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitb07ca972432d775e6bc4de539c97e7cc', 'loadClassLoader'));
     27        spl_autoload_register(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader'), true, true);
     28        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
     29        spl_autoload_unregister(array('ComposerAutoloaderInitff7c20cb8ecfc15a5454f691a0eecf59', 'loadClassLoader'));
    3030
    31         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    32         if ($useStaticLoader) {
    33             require __DIR__ . '/autoload_static.php';
    34 
    35             call_user_func(\Composer\Autoload\ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::getInitializer($loader));
    36         } else {
    37             $map = require __DIR__ . '/autoload_namespaces.php';
    38             foreach ($map as $namespace => $path) {
    39                 $loader->set($namespace, $path);
    40             }
    41 
    42             $map = require __DIR__ . '/autoload_psr4.php';
    43             foreach ($map as $namespace => $path) {
    44                 $loader->setPsr4($namespace, $path);
    45             }
    46 
    47             $classMap = require __DIR__ . '/autoload_classmap.php';
    48             if ($classMap) {
    49                 $loader->addClassMap($classMap);
    50             }
    51         }
     31        require __DIR__ . '/autoload_static.php';
     32        call_user_func(\Composer\Autoload\ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::getInitializer($loader));
    5233
    5334        $loader->register(true);
  • mpress-hide-from-search/trunk/vendor/composer/autoload_static.php

    r2531747 r2906632  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc
     7class ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    5959    {
    6060        return \Closure::bind(function () use ($loader) {
    61             $loader->prefixLengthsPsr4 = ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::$prefixLengthsPsr4;
    62             $loader->prefixDirsPsr4 = ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::$prefixDirsPsr4;
    63             $loader->classMap = ComposerStaticInitb07ca972432d775e6bc4de539c97e7cc::$classMap;
     61            $loader->prefixLengthsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixLengthsPsr4;
     62            $loader->prefixDirsPsr4 = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$prefixDirsPsr4;
     63            $loader->classMap = ComposerStaticInitff7c20cb8ecfc15a5454f691a0eecf59::$classMap;
    6464
    6565        }, null, ClassLoader::class);
  • mpress-hide-from-search/trunk/vendor/composer/installed.php

    r2531747 r2906632  
    1 <?php return array (
    2   'root' =>
    3   array (
    4     'pretty_version' => '1.1.3',
    5     'version' => '1.1.3.0',
    6     'aliases' =>
    7     array (
     1<?php return array(
     2    'root' => array(
     3        'name' => 'wpscholar/mpress-hide-from-search',
     4        'pretty_version' => '1.1.4',
     5        'version' => '1.1.4.0',
     6        'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730',
     7        'type' => 'wordpress-plugin',
     8        'install_path' => __DIR__ . '/../../',
     9        'aliases' => array(),
     10        'dev' => false,
    811    ),
    9     'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    10     'name' => 'wpscholar/mpress-hide-from-search',
    11   ),
    12   'versions' =>
    13   array (
    14     'psr/container' =>
    15     array (
    16       'pretty_version' => '1.1.1',
    17       'version' => '1.1.1.0',
    18       'aliases' =>
    19       array (
    20       ),
    21       'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf',
     12    'versions' => array(
     13        'psr/container' => array(
     14            'pretty_version' => '1.1.2',
     15            'version' => '1.1.2.0',
     16            'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
     17            'type' => 'library',
     18            'install_path' => __DIR__ . '/../psr/container',
     19            'aliases' => array(),
     20            'dev_requirement' => false,
     21        ),
     22        'wp-forge/container' => array(
     23            'pretty_version' => '1.1',
     24            'version' => '1.1.0.0',
     25            'reference' => '1c48853f79b6319e4e7f14b9f3e28c2142ec89b5',
     26            'type' => 'library',
     27            'install_path' => __DIR__ . '/../wp-forge/container',
     28            'aliases' => array(),
     29            'dev_requirement' => false,
     30        ),
     31        'wp-forge/wp-plugin-check' => array(
     32            'pretty_version' => '1.0',
     33            'version' => '1.0.0.0',
     34            'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',
     35            'type' => 'library',
     36            'install_path' => __DIR__ . '/../wp-forge/wp-plugin-check',
     37            'aliases' => array(),
     38            'dev_requirement' => false,
     39        ),
     40        'wp-forge/wp-upgrade-handler' => array(
     41            'pretty_version' => '1.0',
     42            'version' => '1.0.0.0',
     43            'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',
     44            'type' => 'library',
     45            'install_path' => __DIR__ . '/../wp-forge/wp-upgrade-handler',
     46            'aliases' => array(),
     47            'dev_requirement' => false,
     48        ),
     49        'wpscholar/mpress-hide-from-search' => array(
     50            'pretty_version' => '1.1.4',
     51            'version' => '1.1.4.0',
     52            'reference' => '70843b28b5f83753f5335647c31b0e8846c3d730',
     53            'type' => 'wordpress-plugin',
     54            'install_path' => __DIR__ . '/../../',
     55            'aliases' => array(),
     56            'dev_requirement' => false,
     57        ),
    2258    ),
    23     'wp-forge/container' =>
    24     array (
    25       'pretty_version' => '1.0',
    26       'version' => '1.0.0.0',
    27       'aliases' =>
    28       array (
    29       ),
    30       'reference' => 'e76a208d048b163dcb23068b149e16bdcfabc901',
    31     ),
    32     'wp-forge/wp-plugin-check' =>
    33     array (
    34       'pretty_version' => '1.0',
    35       'version' => '1.0.0.0',
    36       'aliases' =>
    37       array (
    38       ),
    39       'reference' => '3497a1bc557ae1108c11fb6cc694ae97ae2d4fc6',
    40     ),
    41     'wp-forge/wp-upgrade-handler' =>
    42     array (
    43       'pretty_version' => '1.0',
    44       'version' => '1.0.0.0',
    45       'aliases' =>
    46       array (
    47       ),
    48       'reference' => 'b0a7f4c66710f95b4c5702fea3af505ea72fb215',
    49     ),
    50     'wpscholar/mpress-hide-from-search' =>
    51     array (
    52       'pretty_version' => '1.1.3',
    53       'version' => '1.1.3.0',
    54       'aliases' =>
    55       array (
    56       ),
    57       'reference' => 'bd6f7d832ff2ac391f05faca0b5a96a5a9030163',
    58     ),
    59   ),
    6059);
  • mpress-hide-from-search/trunk/vendor/composer/platform_check.php

    r2507158 r2906632  
    55$issues = array();
    66
    7 if (!(PHP_VERSION_ID >= 70200)) {
    8     $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.';
     7if (!(PHP_VERSION_ID >= 70400)) {
     8    $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
    99}
    1010
  • mpress-hide-from-search/trunk/vendor/psr/container/src/ContainerExceptionInterface.php

    r2507158 r2906632  
    33namespace Psr\Container;
    44
     5use Throwable;
     6
    57/**
    68 * Base interface representing a generic exception in a container.
    79 */
    8 interface ContainerExceptionInterface
     10interface ContainerExceptionInterface extends Throwable
    911{
    1012}
  • mpress-hide-from-search/trunk/vendor/wp-forge/container/includes/Container.php

    r2328021 r2906632  
    9595     * @return bool
    9696     */
    97     public function has( $id ) {
     97    public function has( string $id ) {
    9898        return array_key_exists( $id, $this->entries );
    9999    }
     
    108108     * @throws NotFoundException
    109109     */
    110     public function raw( $id ) {
     110    public function raw( string $id ) {
    111111        if ( ! $this->has( $id ) ) {
    112112            throw new NotFoundException( sprintf( 'No entry was found for "%s" identifier.', $id ) );
     
    125125     * @throws NotFoundException  No entry was found for **this** identifier.
    126126     */
    127     public function get( $id ) {
     127    public function get( string $id ) {
    128128        // Return class instance, if available.
    129129        if ( isset( $this->instances[ $id ] ) ) {
     
    162162     * @return $this
    163163     */
    164     public function set( $id, $value ) {
     164    public function set( string $id, $value ) {
    165165        $this->entries[ $id ] = $value;
    166166
     
    177177     * @throws NotFoundException
    178178     */
    179     public function delete( $id ) {
     179    public function delete( string $id ) {
    180180        if ( $this->has( $id ) ) {
    181181            $value = $this->get( $id );
     
    200200     * @return $this
    201201     */
    202     public function deleteInstance( $id ) {
     202    public function deleteInstance( string $id ) {
    203203        unset( $this->instances[ $id ] );
    204204
     
    228228     * @throws NotFoundException
    229229     */
    230     public function extend( $id, Closure $closure ) {
     230    public function extend( string $id, Closure $closure ) {
    231231
    232232        // Get the existing raw value
Note: See TracChangeset for help on using the changeset viewer.