<commit_before><?php

/**
 * @package infuse\framework
 * @author <NAME> <<EMAIL>>
 * @link http://jaredtking.com
 * @version 0.1.16
 * @copyright 2013 <NAME>
 * @license MIT
 */

namespace app\api;

use InjectApp;
use app\api\libs\Api;
use app\api\libs\ApiRoute;

class Controller
{
    use InjectApp;
    
    public static $properties = [
        'routes' => [
            'post /api/:module' => 'create',
            'post /api/:module/:model' => 'create',
            'get /api/:module' => 'findAll',
            'get /api/:module/:model' => 'findAll',
            'get /api/:module/:model/:id' => 'findOne',
            'put /api/:module/:id' => 'edit',
            'put /api/:module/:model/:id' => 'edit',
            'delete /api/:module/:id' => 'delete',
            'delete /api/:module/:model/:id' => 'delete',
        ],
    ];

    public function create($req, $res)
    {
        $api = new Api( $this->app );

        $route = new ApiRoute(
            [ [ $api, 'parseFetchModelFromParams' ],
                [ $api, 'parseRequireApiScaffolding' ],
                [ $api, 'parseRequireJson' ],
                [ $api, 'parseRequireCreatePermission' ],
                [ $api, 'parseModelCreateParameters' ] ],
            [ $api, 'queryModelCreate' ],
            [ [ $api, 'transformModelCreate' ],<commit_msg>added missing InjectApp trait<commit_after><?php

/**
 * @package infuse\framework
 * @author <NAME> <<EMAIL>>
 * @link http://jaredtking.com
 * @version 0.1.16
 * @copyright 2013 <NAME>
 * @license MIT
 */

namespace app\api;

use app\api\libs\Api;
use app\api\libs\ApiRoute;

class Controller
{
    use \InjectApp;
    
    public static $properties = [
        'routes' => [
            'post /api/:module' => 'create',
            'post /api/:module/:model' => 'create',
            'get /api/:module' => 'findAll',
            'get /api/:module/:model' => 'findAll',
            'get /api/:module/:model/:id' => 'findOne',
            'put /api/:module/:id' => 'edit',
            'put /api/:module/:model/:id' => 'edit',
            'delete /api/:module/:id' => 'delete',
            'delete /api/:module/:model/:id' => 'delete',
        ],
    ];

    public function create($req, $res)
    {
        $api = new Api( $this->app );

        $route = new ApiRoute(
            [ [ $api, 'parseFetchModelFromParams' ],
                [ $api, 'parseRequireApiScaffolding' ],
                [ $api, 'parseRequireJson' ],
                [ $api, 'parseRequireCreatePermission' ],
                [ $api, 'parseModelCreateParameters' ] ],
            [ $api, 'queryModelCreate' ],
            [ [ $api, 'transformModelCreate' ],
{'fraction_non_alphanumeric': 0.18133935289691497, 'fraction_numerical': 0.006019563581640331, 'mean_word_length': 1.951165371809101, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1732493', 'n_tokens_mistral': 844, 'n_tokens_neox': 866, 'n_words': 167}