20 lines
		
	
	
		
			418 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			418 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace kernel\helpers;
 | 
						|
 | 
						|
class Manifest
 | 
						|
{
 | 
						|
 | 
						|
    public static function getWithVars(string $manifestJson): array
 | 
						|
    {
 | 
						|
        $manifest = json_decode($manifestJson, true);
 | 
						|
        $keys = ["{slug}" => $manifest['slug']];
 | 
						|
        foreach($keys as $key => $value)
 | 
						|
        {
 | 
						|
            $manifestJson = str_replace($key, $value, $manifestJson);
 | 
						|
        }
 | 
						|
 | 
						|
        return json_decode($manifestJson, true);
 | 
						|
    }
 | 
						|
 | 
						|
} |