<commit_before><?php

/*
 * This file is part of NodalFlow.
 *     (c) <NAME> / https://github.com/fab2s/NodalFlow
 * This source file is licensed under the MIT license which you will
 * find in the LICENSE file or at https://opensource.org/licenses/MIT
 */

namespace fab2s\NodalFlow\Flows;

use fab2s\NodalFlow\NodalFlowException;
use fab2s\NodalFlow\Nodes\NodeInterface;

/**
 * Interface FlowInterface
 */
interface FlowInterface extends FlowIdInterface
{
    /**
     * get the Node Map
     *
     * @return array
     */
    public function getNodeMap();

    /**
     * Get the latest Node stats
     *
     * @return array
     */
    public function getStats();

    /**
     * Adds a Node to the Flow
     *
     * @param NodeInterface $node
     *
     * @throws NodalFlowException
     *
     * @return $this
     */
    public function add(NodeInterface $node);

    /**
     * Replaces a node with another one
     *
     * @param int           $nodeIdx
     * @param NodeInterface $node
     *
     * @throws NodalFlowException<commit_msg>expose getFlowMap<commit_after><?php

/*
 * This file is part of NodalFlow.
 *     (c) <NAME> / https://github.com/fab2s/NodalFlow
 * This source file is licensed under the MIT license which you will
 * find in the LICENSE file or at https://opensource.org/licenses/MIT
 */

namespace fab2s\NodalFlow\Flows;

use fab2s\NodalFlow\NodalFlowException;
use fab2s\NodalFlow\Nodes\NodeInterface;

/**
 * Interface FlowInterface
 */
interface FlowInterface extends FlowIdInterface
{
    /**
     * get the Node Map
     *
     * @return array
     */
    public function getNodeMap();

    /**
     * Get the stats array with latest Node stats
     *
     * @return FlowMapInterface
     */
    public function getFlowMap();

    /**
     * Get the latest Node stats
     *
     * @return array
     */
    public function getStats();

    /**
     * Adds a Node to the Flow
     *
     * @param NodeInterface $node
     *
     * @throws NodalFlowException
     *
     * @return $this
     */
    public function add(NodeInterface $node);

    /**
     * Replaces a node with another one
     *
     * @param int           $nodeIdx
     * @param NodeInterface $node
     *
     * @throws NodalFlowException
{'fraction_non_alphanumeric': 0.1002661934338953, 'fraction_numerical': 0.00354924578527063, 'mean_word_length': 2.2260371959942775, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '3367632', 'n_tokens_mistral': 696, 'n_tokens_neox': 670, 'n_words': 197}