PHP code example of netresearch / contexts

1. Go to this page and download the library: Download netresearch/contexts library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

netresearch / contexts example snippets


use Netresearch\Contexts\Api\ContextMatcher;

if (ContextMatcher::getInstance()->matches('mobile')) {
    // Mobile-specific logic
}
bash
# Static analysis (level 10)
composer ci:test:php:phpstan

# Code style check
composer ci:test:php:cgl

# Code style fix
composer ci:cgl